first commit

This commit is contained in:
lailadwikartika 2026-04-14 20:07:53 +07:00
parent f995890130
commit 1eb3666f15
53 changed files with 490 additions and 175 deletions

View File

@ -1,6 +1,6 @@
APP_NAME=Laravel APP_NAME=Laravel
APP_ENV=local APP_ENV=local
APP_KEY= APP_KEY=base64:z0LwGs8KEUKLZiscpb4+KURGPLdoVKo4L6YoGqB40uE=
APP_DEBUG=true APP_DEBUG=true
APP_URL=http://localhost APP_URL=http://localhost
@ -20,14 +20,14 @@ LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug LOG_LEVEL=debug
DB_CONNECTION=sqlite DB_CONNECTION=mysql
# DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
# DB_PORT=3306 DB_PORT=3306
# DB_DATABASE=laravel DB_DATABASE=smk_nasional
# DB_USERNAME=root DB_USERNAME=root
# DB_PASSWORD= DB_PASSWORD=
SESSION_DRIVER=database SESSION_DRIVER=file
SESSION_LIFETIME=120 SESSION_LIFETIME=120
SESSION_ENCRYPT=false SESSION_ENCRYPT=false
SESSION_PATH=/ SESSION_PATH=/
@ -35,6 +35,10 @@ SESSION_DOMAIN=null
BROADCAST_CONNECTION=log BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local FILESYSTEM_DISK=local
# Path untuk penyimpanan di hosting (di luar project)
STORAGE_PATH=/home/kubgnmev/public_html/penyimpanan
STORAGE_URL=/penyimpanan
QUEUE_CONNECTION=database QUEUE_CONNECTION=database
CACHE_STORE=database CACHE_STORE=database

15
app/Helpers.php Normal file
View File

@ -0,0 +1,15 @@
<?php
if (!function_exists('storage_url')) {
function storage_url(string $path = ''): string {
$storageUrl = env('STORAGE_URL', '/penyimpanan');
return rtrim($storageUrl, '/') . '/' . ltrim($path, '/');
}
}
if (!function_exists('storage_path_external')) {
function storage_path_external(): string {
return env('STORAGE_PATH', public_path('penyimpanan'));
}
}

View File

@ -7,9 +7,15 @@
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
class BkkController extends Controller class BkkController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
/** /**
* Display a listing of the resource. * Display a listing of the resource.
*/ */
@ -35,7 +41,7 @@ public function create()
*/ */
public function store(Request $request) public function store(Request $request)
{ {
$request->validate([ $request->validate([
'judul_lowongan' => 'required|string|max:255', 'judul_lowongan' => 'required|string|max:255',
'nama_perusahaan' => 'required|string|max:255', 'nama_perusahaan' => 'required|string|max:255',
@ -46,20 +52,24 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
// Handle upload foto - SIMPAN LANGSUNG KE public/storage $storagePath = $this->storagePath();
// Handle upload foto - SIMPAN KE folder penyimpanan eksternal
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$filename = time() . '_' . $request->file('foto')->getClientOriginalName(); if (!file_exists($storagePath . '/foto_bkk')) {
$request->file('foto')->move(public_path('storage/foto_bkk'), $filename); mkdir($storagePath . '/foto_bkk', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_bkk', $filename);
$data['foto'] = 'foto_bkk/' . $filename; $data['foto'] = 'foto_bkk/' . $filename;
} }
Bkk::create($data); Bkk::create($data);
return redirect()->route('bkk.index')->with('success', 'Data BKK berhasil ditambahkan.'); return redirect()->route('bkk.index')->with('success', 'Data BKK berhasil ditambahkan.');
} }
/** /**
* Display the specified resource for public view. * Display the specified resource for public view.
*/ */
@ -82,7 +92,7 @@ public function edit(Bkk $bkk)
* Update the specified resource in storage. * Update the specified resource in storage.
*/ */
public function update(Request $request, $id_bkk) public function update(Request $request, $id_bkk)
{ {
$bkk = Bkk::findOrFail($id_bkk); $bkk = Bkk::findOrFail($id_bkk);
$request->validate([ $request->validate([
@ -96,14 +106,20 @@ public function update(Request $request, $id_bkk)
$data = $request->all(); $data = $request->all();
$storagePath = $this->storagePath();
// Handle upload foto baru // Handle upload foto baru
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
// Hapus foto lama jika ada // Hapus foto lama jika ada
if ($bkk->foto && file_exists(public_path('storage/' . $bkk->foto))) { if ($bkk->foto && file_exists($storagePath . '/' . $bkk->foto)) {
unlink(public_path('storage/' . $bkk->foto)); unlink($storagePath . '/' . $bkk->foto);
} }
$filename = time() . '_' . $request->file('foto')->getClientOriginalName();
$request->file('foto')->move(public_path('storage/foto_bkk'), $filename); if (!file_exists($storagePath . '/foto_bkk')) {
mkdir($storagePath . '/foto_bkk', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_bkk', $filename);
$data['foto'] = 'foto_bkk/' . $filename; $data['foto'] = 'foto_bkk/' . $filename;
} else { } else {
unset($data['foto']); unset($data['foto']);
@ -111,7 +127,7 @@ public function update(Request $request, $id_bkk)
$bkk->update($data); $bkk->update($data);
return redirect()->route('bkk.index')->with('success', 'Data BKK berhasil diperbarui.'); return redirect()->route('bkk.index')->with('success', 'Data BKK berhasil diperbarui.');
} }
/** /**
* Remove the specified resource from storage. * Remove the specified resource from storage.
@ -121,8 +137,9 @@ public function destroy($id_bkk)
$bkk = Bkk::findOrFail($id_bkk); $bkk = Bkk::findOrFail($id_bkk);
// Hapus foto dari storage jika ada // Hapus foto dari storage jika ada
if ($bkk->foto) { $storagePath = $this->storagePath();
Storage::disk('public')->delete($bkk->foto); if ($bkk->foto && file_exists($storagePath . '/' . $bkk->foto)) {
unlink($storagePath . '/' . $bkk->foto);
} }
$bkk->delete(); $bkk->delete();

View File

@ -6,9 +6,15 @@
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
class EkstrakurikulerController extends Controller class EkstrakurikulerController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
public function index() public function index()
{ {
$data = Ekstrakurikuler::orderBy('id_ekstrakurikuler', 'desc')->paginate(15); $data = Ekstrakurikuler::orderBy('id_ekstrakurikuler', 'desc')->paginate(15);
@ -29,11 +35,17 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_ekstrakurikuler', 'public'); if (!file_exists($storagePath . '/foto_ekstrakurikuler')) {
mkdir($storagePath . '/foto_ekstrakurikuler', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_ekstrakurikuler', $filename);
$data['foto'] = 'foto_ekstrakurikuler/' . $filename;
} }
Ekstrakurikuler::create($data); Ekstrakurikuler::create($data);
@ -58,12 +70,19 @@ public function update(Request $request, $id_ekstrakurikuler)
]); ]);
$data = $request->all(); $data = $request->all();
$storagePath = $this->storagePath();
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
if ($ekstrakurikuler->foto && Storage::disk('public')->exists($ekstrakurikuler->foto)) { if ($ekstrakurikuler->foto && file_exists($storagePath . '/' . $ekstrakurikuler->foto)) {
Storage::disk('public')->delete($ekstrakurikuler->foto); unlink($storagePath . '/' . $ekstrakurikuler->foto);
} }
$data['foto'] = $request->file('foto')->store('foto_ekstrakurikuler', 'public');
if (!file_exists($storagePath . '/foto_ekstrakurikuler')) {
mkdir($storagePath . '/foto_ekstrakurikuler', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_ekstrakurikuler', $filename);
$data['foto'] = 'foto_ekstrakurikuler/' . $filename;
} }
$ekstrakurikuler->update($data); $ekstrakurikuler->update($data);
@ -75,8 +94,10 @@ public function destroy($id_ekstrakurikuler)
{ {
$ekstrakurikuler = Ekstrakurikuler::findOrFail($id_ekstrakurikuler); $ekstrakurikuler = Ekstrakurikuler::findOrFail($id_ekstrakurikuler);
if ($ekstrakurikuler->foto && Storage::disk('public')->exists($ekstrakurikuler->foto)) { $storagePath = $this->storagePath();
Storage::disk('public')->delete($ekstrakurikuler->foto);
if ($ekstrakurikuler->foto && file_exists($storagePath . '/' . $ekstrakurikuler->foto)) {
unlink($storagePath . '/' . $ekstrakurikuler->foto);
} }
$ekstrakurikuler->delete(); $ekstrakurikuler->delete();

View File

@ -5,9 +5,15 @@
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\Fasilitas; use App\Models\Fasilitas;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
class FasilitasController extends Controller class FasilitasController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
public function index() public function index()
{ {
$data = Fasilitas::orderBy('id_fasilitas', 'desc')->paginate(15); $data = Fasilitas::orderBy('id_fasilitas', 'desc')->paginate(15);
@ -28,12 +34,18 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
// Handle upload foto // Handle upload foto
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_fasilitas', 'public'); if (!file_exists($storagePath . '/foto_fasilitas')) {
mkdir($storagePath . '/foto_fasilitas', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_fasilitas', $filename);
$data['foto'] = 'foto_fasilitas/' . $filename;
} }
Fasilitas::create($data); Fasilitas::create($data);
@ -58,10 +70,21 @@ public function update(Request $request, $id_fasilitas)
]); ]);
$data = $request->all(); $data = $request->all();
$storagePath = $this->storagePath();
// Handle upload foto baru // Handle upload foto baru
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_fasilitas', 'public'); // Hapus foto lama jika ada
if ($fasilitas->foto && file_exists($storagePath . '/' . $fasilitas->foto)) {
unlink($storagePath . '/' . $fasilitas->foto);
}
if (!file_exists($storagePath . '/foto_fasilitas')) {
mkdir($storagePath . '/foto_fasilitas', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_fasilitas', $filename);
$data['foto'] = 'foto_fasilitas/' . $filename;
} else { } else {
unset($data['foto']); unset($data['foto']);
} }
@ -73,7 +96,14 @@ public function update(Request $request, $id_fasilitas)
public function destroy($id_fasilitas) public function destroy($id_fasilitas)
{ {
Fasilitas::findOrFail($id_fasilitas)->delete(); $fasilitas = Fasilitas::findOrFail($id_fasilitas);
$storagePath = $this->storagePath();
if ($fasilitas->foto && file_exists($storagePath . '/' . $fasilitas->foto)) {
unlink($storagePath . '/' . $fasilitas->foto);
}
$fasilitas->delete();
return redirect()->route('fasilitas.index')->with('success', 'Data berhasil dihapus'); return redirect()->route('fasilitas.index')->with('success', 'Data berhasil dihapus');
} }
} }

View File

@ -4,9 +4,15 @@
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\Guru; use App\Models\Guru;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
class GuruController extends Controller class GuruController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
public function index() public function index()
{ {
$data = Guru::orderBy('id_guru', 'desc')->paginate(15); $data = Guru::orderBy('id_guru', 'desc')->paginate(15);
@ -31,12 +37,18 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
// Handle upload foto // Handle upload foto
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_guru', 'public'); if (!file_exists($storagePath . '/foto_guru')) {
mkdir($storagePath . '/foto_guru', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_guru', $filename);
$data['foto'] = 'foto_guru/' . $filename;
} }
Guru::create($data); Guru::create($data);
@ -65,10 +77,21 @@ public function update(Request $request, $id_guru)
]); ]);
$data = $request->all(); $data = $request->all();
$storagePath = $this->storagePath();
// Handle upload foto baru // Handle upload foto baru
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_guru', 'public'); // Hapus foto lama jika ada
if ($guru->foto && file_exists($storagePath . '/' . $guru->foto)) {
unlink($storagePath . '/' . $guru->foto);
}
if (!file_exists($storagePath . '/foto_guru')) {
mkdir($storagePath . '/foto_guru', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_guru', $filename);
$data['foto'] = 'foto_guru/' . $filename;
} else { } else {
unset($data['foto']); unset($data['foto']);
} }
@ -80,7 +103,14 @@ public function update(Request $request, $id_guru)
public function destroy($id_guru) public function destroy($id_guru)
{ {
Guru::findOrFail($id_guru)->delete(); $guru = Guru::findOrFail($id_guru);
$storagePath = $this->storagePath();
if ($guru->foto && file_exists($storagePath . '/' . $guru->foto)) {
unlink($storagePath . '/' . $guru->foto);
}
$guru->delete();
return redirect()->route('guru.index')->with('success', 'Data berhasil dihapus'); return redirect()->route('guru.index')->with('success', 'Data berhasil dihapus');
} }
} }

View File

@ -6,9 +6,15 @@
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\File;
class InformasiUmumController extends Controller class InformasiUmumController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
public function index() public function index()
{ {
$data = InformasiUmum::orderBy('id_informasi_umum', 'desc')->paginate(15); $data = InformasiUmum::orderBy('id_informasi_umum', 'desc')->paginate(15);
@ -30,12 +36,18 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
if ($request->hasFile('foto_struktur')) { if ($request->hasFile('foto_struktur')) {
$data['foto_struktur'] = $request->file('foto_struktur')->store('foto_informasi_umum', 'public'); if (!file_exists($storagePath . '/foto_informasi_umum')) {
mkdir($storagePath . '/foto_informasi_umum', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto_struktur')->getClientOriginalName());
$request->file('foto_struktur')->move($storagePath . '/foto_informasi_umum', $filename);
$data['foto_struktur'] = 'foto_informasi_umum/' . $filename;
} }
$data['id_user'] = Auth::id();
InformasiUmum::create($data); InformasiUmum::create($data);
@ -60,13 +72,20 @@ public function update(Request $request, $id)
]); ]);
$data = $request->all(); $data = $request->all();
$storagePath = $this->storagePath();
if ($request->hasFile('foto_struktur')) { if ($request->hasFile('foto_struktur')) {
// Delete old photo if exists // Delete old photo if exists
if ($informasiUmum->foto_struktur) { if ($informasiUmum->foto_struktur && file_exists($storagePath . '/' . $informasiUmum->foto_struktur)) {
Storage::disk('public')->delete($informasiUmum->foto_struktur); unlink($storagePath . '/' . $informasiUmum->foto_struktur);
} }
$data['foto_struktur'] = $request->file('foto_struktur')->store('foto_informasi_umum', 'public');
if (!file_exists($storagePath . '/foto_informasi_umum')) {
mkdir($storagePath . '/foto_informasi_umum', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto_struktur')->getClientOriginalName());
$request->file('foto_struktur')->move($storagePath . '/foto_informasi_umum', $filename);
$data['foto_struktur'] = 'foto_informasi_umum/' . $filename;
} else { } else {
unset($data['foto_struktur']); unset($data['foto_struktur']);
} }
@ -79,9 +98,13 @@ public function update(Request $request, $id)
public function destroy($id) public function destroy($id)
{ {
$informasiUmum = InformasiUmum::findOrFail($id); $informasiUmum = InformasiUmum::findOrFail($id);
if ($informasiUmum->foto_struktur) {
Storage::disk('public')->delete($informasiUmum->foto_struktur); $storagePath = $this->storagePath();
if ($informasiUmum->foto_struktur && file_exists($storagePath . '/' . $informasiUmum->foto_struktur)) {
unlink($storagePath . '/' . $informasiUmum->foto_struktur);
} }
$informasiUmum->delete(); $informasiUmum->delete();
return redirect()->route('informasi-umum.index')->with('success', 'Data berhasil dihapus'); return redirect()->route('informasi-umum.index')->with('success', 'Data berhasil dihapus');
} }

View File

@ -5,10 +5,16 @@
use App\Models\KepalaSekolah; use App\Models\KepalaSekolah;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class KepalaSekolahController extends Controller class KepalaSekolahController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
public function index() public function index()
{ {
$data = KepalaSekolah::orderBy('id_kepala_sekolah', 'desc')->paginate(15); $data = KepalaSekolah::orderBy('id_kepala_sekolah', 'desc')->paginate(15);
@ -33,12 +39,18 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
// Handle upload foto // Handle upload foto
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_kepala_sekolah', 'public'); if (!file_exists($storagePath . '/foto_kepala_sekolah')) {
mkdir($storagePath . '/foto_kepala_sekolah', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_kepala_sekolah', $filename);
$data['foto'] = 'foto_kepala_sekolah/' . $filename;
} }
KepalaSekolah::create($data); KepalaSekolah::create($data);
@ -66,14 +78,21 @@ public function update(Request $request, $id_kepala_sekolah)
]); ]);
$data = $request->all(); $data = $request->all();
$storagePath = $this->storagePath();
// Handle upload foto baru // Handle upload foto baru
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
// Hapus foto lama jika ada // Hapus foto lama jika ada
if ($kepala->foto) { if ($kepala->foto && file_exists($storagePath . '/' . $kepala->foto)) {
Storage::disk('public')->delete($kepala->foto); unlink($storagePath . '/' . $kepala->foto);
} }
$data['foto'] = $request->file('foto')->store('foto_kepala_sekolah', 'public');
if (!file_exists($storagePath . '/foto_kepala_sekolah')) {
mkdir($storagePath . '/foto_kepala_sekolah', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_kepala_sekolah', $filename);
$data['foto'] = 'foto_kepala_sekolah/' . $filename;
} else { } else {
unset($data['foto']); unset($data['foto']);
} }
@ -87,10 +106,13 @@ public function destroy($id_kepala_sekolah)
{ {
$kepala = KepalaSekolah::findOrFail($id_kepala_sekolah); $kepala = KepalaSekolah::findOrFail($id_kepala_sekolah);
$storagePath = $this->storagePath();
// Hapus foto dari storage jika ada // Hapus foto dari storage jika ada
if ($kepala->foto) { if ($kepala->foto && file_exists($storagePath . '/' . $kepala->foto)) {
Storage::disk('public')->delete($kepala->foto); unlink($storagePath . '/' . $kepala->foto);
} }
$kepala->delete(); $kepala->delete();
return redirect()->route('kepala-sekolah.index')->with('success', 'Data berhasil dihapus'); return redirect()->route('kepala-sekolah.index')->with('success', 'Data berhasil dihapus');
} }

View File

@ -7,9 +7,15 @@
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
class PbdpController extends Controller class PbdpController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
public function index() public function index()
{ {
// gunakan nama variabel $pbdp agar sesuai dengan yang dipakai di Blade // gunakan nama variabel $pbdp agar sesuai dengan yang dipakai di Blade
@ -47,11 +53,17 @@ public function store(Request $request)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$data['foto'] = $request->file('foto')->store('foto_pbdp', 'public'); if (!file_exists($storagePath . '/foto_pbdp')) {
mkdir($storagePath . '/foto_pbdp', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_pbdp', $filename);
$data['foto'] = 'foto_pbdp/' . $filename;
} }
Pbdp::create($data); Pbdp::create($data);
@ -77,14 +89,21 @@ public function update(Request $request, $id_pbdp)
]); ]);
$data = $request->all(); $data = $request->all();
$data['id_user'] = Auth::id(); $data['id_user'] = Auth::id();
$storagePath = $this->storagePath();
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
if ($pbdp->foto) { if ($pbdp->foto && file_exists($storagePath . '/' . $pbdp->foto)) {
Storage::disk('public')->delete($pbdp->foto); unlink($storagePath . '/' . $pbdp->foto);
} }
$data['foto'] = $request->file('foto')->store('foto_pbdp', 'public');
if (!file_exists($storagePath . '/foto_pbdp')) {
mkdir($storagePath . '/foto_pbdp', 0755, true);
}
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $request->file('foto')->getClientOriginalName());
$request->file('foto')->move($storagePath . '/foto_pbdp', $filename);
$data['foto'] = 'foto_pbdp/' . $filename;
} else { } else {
unset($data['foto']); unset($data['foto']);
} }
@ -98,9 +117,12 @@ public function destroy($id_pbdp)
{ {
$pbdp = Pbdp::findOrFail($id_pbdp); $pbdp = Pbdp::findOrFail($id_pbdp);
if ($pbdp->foto) { $storagePath = $this->storagePath();
Storage::disk('public')->delete($pbdp->foto);
if ($pbdp->foto && file_exists($storagePath . '/' . $pbdp->foto)) {
unlink($storagePath . '/' . $pbdp->foto);
} }
$pbdp->delete(); $pbdp->delete();
return redirect()->route('pbdp.index')->with('success', 'Data berhasil dihapus'); return redirect()->route('pbdp.index')->with('success', 'Data berhasil dihapus');
} }

View File

@ -7,11 +7,17 @@
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\File;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Password; use Illuminate\Validation\Rules\Password;
class ProfileController extends Controller class ProfileController extends Controller
{ {
protected function storagePath()
{
return env('STORAGE_PATH', public_path('penyimpanan'));
}
/** /**
* Menampilkan halaman form profil. * Menampilkan halaman form profil.
*/ */
@ -42,11 +48,18 @@ public function update(Request $request)
} }
if ($request->hasFile('foto')) { if ($request->hasFile('foto')) {
$storagePath = $this->storagePath();
// Hapus foto lama jika ada // Hapus foto lama jika ada
if ($user->foto && Storage::disk('public')->exists($user->foto)) { if ($user->foto && file_exists($storagePath . '/' . $user->foto)) {
Storage::disk('public')->delete($user->foto); unlink($storagePath . '/' . $user->foto);
} }
$user->foto = $request->file('foto')->store('profile-photos', 'public');
// Simpan foto ke folder penyimpanan eksternal
$file = $request->file('foto');
$filename = time() . '_' . preg_replace('/[^a-zA-Z0-9._-]/', '_', $file->getClientOriginalName());
$file->move($storagePath . '/profile-photos', $filename);
$user->foto = 'profile-photos/' . $filename;
} }
$user->save(); $user->save();

View File

@ -40,8 +40,17 @@
'public' => [ 'public' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => env('STORAGE_PATH', public_path('penyimpanan')),
'url' => env('APP_URL').'/storage', 'url' => env('STORAGE_URL', '/penyimpanan'),
'visibility' => 'public',
'throw' => false,
'report' => false,
],
'penyimpanan' => [
'driver' => 'local',
'root' => env('STORAGE_PATH', public_path('penyimpanan')),
'url' => env('STORAGE_URL', '/penyimpanan'),
'visibility' => 'public', 'visibility' => 'public',
'throw' => false, 'throw' => false,
'report' => false, 'report' => false,
@ -74,7 +83,6 @@
*/ */
'links' => [ 'links' => [
public_path('storage') => storage_path('app/public'),
], ],
]; ];

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->json('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sessions');
}
};

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->text('value');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
}
};

View File

@ -14,8 +14,8 @@ class DatabaseSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
// Hapus atau beri komentar user lain jika tidak diperlukan // // Hapus atau beri komentar user lain jika tidak diperlukan
// dan fokus pada satu user admin yang jelas. // // dan fokus pada satu user admin yang jelas.
User::firstOrCreate( User::firstOrCreate(
['email' => 'akunc4086@gmail.com'], ['email' => 'akunc4086@gmail.com'],
[ [
@ -48,5 +48,13 @@ public function run(): void
] ]
); );
User::firstOrCreate(
['email' => 'ardhikayanuar58@gmail.com'],
[
'name' => 'Super Admin',
'password' => Hash::make('password'),
]
);
} }
} }

View File

@ -47,7 +47,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -57,7 +57,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -206,7 +206,7 @@
<td>{{ \Carbon\Carbon::parse($bkk->tanggal_ditutup)->translatedFormat('d M Y') }}</td> <td>{{ \Carbon\Carbon::parse($bkk->tanggal_ditutup)->translatedFormat('d M Y') }}</td>
<td> <td>
@if ($bkk->foto) @if ($bkk->foto)
<img src="{{ asset('storage/' . $bkk->foto) }}" alt="Foto" width="60" class="rounded"> <img src="{{ asset('penyimpanan/' . $bkk->foto) }}" alt="Foto" width="60" class="rounded">
@else @else
<span class="text-muted">Tidak ada foto</span> <!-- UBAH: dari "-" ke "Tidak ada foto" --> <span class="text-muted">Tidak ada foto</span> <!-- UBAH: dari "-" ke "Tidak ada foto" -->
@endif @endif

View File

@ -46,7 +46,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -210,7 +210,7 @@
<div class="mb-3"> <div class="mb-3">
<label for="foto" class="form-label">Foto (Opsional)</label> <label for="foto" class="form-label">Foto (Opsional)</label>
@if ($bkk->foto) @if ($bkk->foto)
<img src="{{ asset('storage/' . $bkk->foto) }}" alt="Foto saat ini" class="d-block mb-2 rounded" width="150"> <img src="{{ asset('penyimpanan/' . $bkk->foto) }}" alt="Foto saat ini" class="d-block mb-2 rounded" width="150">
@endif @endif
<input class="form-control @error('foto') is-invalid @enderror" type="file" id="foto" name="foto"> <input class="form-control @error('foto') is-invalid @enderror" type="file" id="foto" name="foto">
@error('foto') @error('foto')

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -207,7 +207,7 @@ class="form-control @error('keterangan') is-invalid @enderror"
<div class="col-sm-9"> <div class="col-sm-9">
@if ($ekstrakurikuler->foto) @if ($ekstrakurikuler->foto)
<div class="mb-2"> <div class="mb-2">
<img src="{{ asset('storage/' . $ekstrakurikuler->foto) }}" alt="Foto Lama" <img src="{{ asset('penyimpanan/' . $ekstrakurikuler->foto) }}" alt="Foto Lama"
width="100" class="rounded shadow"> width="100" class="rounded shadow">
</div> </div>
@endif @endif

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -206,7 +206,7 @@ class="form-control @error('keterangan') is-invalid @enderror"
<div class="col-sm-9"> <div class="col-sm-9">
@if ($fasilitas->foto) @if ($fasilitas->foto)
<div class="mb-2"> <div class="mb-2">
<img src="{{ asset('storage/' . $fasilitas->foto) }}" alt="Foto Lama" <img src="{{ asset('penyimpanan/' . $fasilitas->foto) }}" alt="Foto Lama"
width="100" class="rounded shadow"> width="100" class="rounded shadow">
</div> </div>
@endif @endif

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -223,7 +223,7 @@ class="form-control @error('mata_pelajaran') is-invalid @enderror"
<div class="col-sm-9"> <div class="col-sm-9">
@if ($guru->foto) @if ($guru->foto)
<div class="mb-2"> <div class="mb-2">
<img src="{{ asset('storage/' . $guru->foto) }}" alt="Foto Lama" <img src="{{ asset('penyimpanan/' . $guru->foto) }}" alt="Foto Lama"
width="100" class="rounded shadow"> width="100" class="rounded shadow">
</div> </div>
@endif @endif

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -206,7 +206,7 @@
<div class="col-sm-9"> <div class="col-sm-9">
@if($informasiUmum->foto_struktur) @if($informasiUmum->foto_struktur)
<div class="mb-2"> <div class="mb-2">
<img src="{{ asset('storage/' . $informasiUmum->foto_struktur) }}" alt="Foto Struktur" width="200" class="img-thumbnail"> <img src="{{ asset('penyimpanan/' . $informasiUmum->foto_struktur) }}" alt="Foto Struktur" width="200" class="img-thumbnail">
</div> </div>
@endif @endif
<input class="form-control @error('foto_struktur') is-invalid @enderror" type="file" id="foto_struktur" name="foto_struktur"> <input class="form-control @error('foto_struktur') is-invalid @enderror" type="file" id="foto_struktur" name="foto_struktur">

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -211,7 +211,7 @@ class="form-control @error('nip_nuptk') is-invalid @enderror"
<div class="col-sm-9"> <div class="col-sm-9">
@if ($kepala->foto) @if ($kepala->foto)
<div class="mb-2"> <div class="mb-2">
<img src="{{ asset('storage/' . $kepala->foto) }}" alt="Foto Kepala Sekolah" <img src="{{ asset('penyimpanan/' . $kepala->foto) }}" alt="Foto Kepala Sekolah"
width="150" class="img-thumbnail shadow-sm"> width="150" class="img-thumbnail shadow-sm">
</div> </div>
@endif @endif

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -56,7 +56,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -203,7 +203,7 @@
<td>{{ $ekstrakurikuler->keterangan }}</td> <td>{{ $ekstrakurikuler->keterangan }}</td>
<td> <td>
@if ($ekstrakurikuler->foto) @if ($ekstrakurikuler->foto)
<img src="{{ asset('storage/' . $ekstrakurikuler->foto) }}" alt="Foto" <img src="{{ asset('penyimpanan/' . $ekstrakurikuler->foto) }}" alt="Foto"
width="60" class="rounded"> width="60" class="rounded">
@else @else
<span class="text-muted">-</span> <span class="text-muted">-</span>

View File

@ -56,7 +56,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -203,7 +203,7 @@
<td>{{ $fasilitas->keterangan }}</td> <td>{{ $fasilitas->keterangan }}</td>
<td> <td>
@if ($fasilitas->foto) @if ($fasilitas->foto)
<img src="{{ asset('storage/' . $fasilitas->foto) }}" alt="Foto" <img src="{{ asset('penyimpanan/' . $fasilitas->foto) }}" alt="Foto"
width="60" class="rounded"> width="60" class="rounded">
@else @else
<span class="text-muted">-</span> <span class="text-muted">-</span>

View File

@ -46,7 +46,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -40,7 +40,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -55,7 +55,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -209,7 +209,7 @@
<td>{{ $guru->tanggal_masuk ? \Carbon\Carbon::parse($guru->tanggal_masuk)->translatedFormat('d M Y') : '-' }}</td> <td>{{ $guru->tanggal_masuk ? \Carbon\Carbon::parse($guru->tanggal_masuk)->translatedFormat('d M Y') : '-' }}</td>
<td> <td>
@if ($guru->foto) @if ($guru->foto)
<img src="{{ asset('storage/' . $guru->foto) }}" alt="Foto" <img src="{{ asset('penyimpanan/' . $guru->foto) }}" alt="Foto"
width="60" class="rounded"> width="60" class="rounded">
@else @else
<span class="text-muted">-</span> <span class="text-muted">-</span>

View File

@ -48,7 +48,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -183,7 +183,7 @@
<td>{{ Str::limit($item->misi, 50) }}</td> <td>{{ Str::limit($item->misi, 50) }}</td>
<td> <td>
@if ($item->foto_struktur) @if ($item->foto_struktur)
<img src="{{ asset('storage/' . $item->foto_struktur) }}" alt="Foto" width="60" class="rounded"> <img src="{{ asset('penyimpanan/' . $item->foto_struktur) }}" alt="Foto" width="60" class="rounded">
@else @else
<span class="text-muted">-</span> <span class="text-muted">-</span>
@endif @endif

View File

@ -56,7 +56,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -48,7 +48,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -199,7 +199,7 @@
<td>{{ $kepala->tanggal_lahir }}</td> <td>{{ $kepala->tanggal_lahir }}</td>
<td> <td>
@if ($kepala->foto) @if ($kepala->foto)
<img src="{{ asset('storage/' . $kepala->foto) }}" alt="Foto" <img src="{{ asset('penyimpanan/' . $kepala->foto) }}" alt="Foto"
width="60" class="rounded"> width="60" class="rounded">
@else @else
<span class="text-muted">-</span> <span class="text-muted">-</span>

View File

@ -54,7 +54,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->

View File

@ -25,7 +25,7 @@
</div> </div>
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" alt="Profile" class="rounded-circle"> <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a> </a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow profile"> <ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow profile">

View File

@ -178,6 +178,27 @@
color: #D30000; color: #D30000;
text-decoration: underline; text-decoration: underline;
} }
.password-toggle {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
color: #6c757d;
background: none;
border: none;
padding: 0;
z-index: 10;
}
.password-toggle:hover {
color: #800000;
}
.password-input-wrapper {
position: relative;
}
</style> </style>
</head> </head>
@ -219,8 +240,13 @@
<div class="mb-3"> <div class="mb-3">
<label for="password" class="form-label"><i class="bi bi-lock me-1"></i> Password</label> <label for="password" class="form-label"><i class="bi bi-lock me-1"></i> Password</label>
<div class="password-input-wrapper">
<input type="password" class="form-control @error('password') is-invalid @enderror" <input type="password" class="form-control @error('password') is-invalid @enderror"
name="password" id="password" placeholder="Masukkan password" required> name="password" id="password" placeholder="Masukkan password" required>
<button type="button" class="password-toggle" onclick="togglePassword('password', 'togglePasswordBtn')">
<i class="bi bi-eye-slash" id="togglePasswordBtn"></i>
</button>
</div>
@error('password') @error('password')
<div class="text-danger small mt-1"> <div class="text-danger small mt-1">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
@ -249,6 +275,23 @@
</a> </a>
</div> </div>
</div> </div>
<script>
function togglePassword(inputId, btnId) {
const passwordInput = document.getElementById(inputId);
const toggleBtn = document.getElementById(btnId);
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
toggleBtn.classList.remove('bi-eye-slash');
toggleBtn.classList.add('bi-eye');
} else {
passwordInput.type = 'password';
toggleBtn.classList.remove('bi-eye');
toggleBtn.classList.add('bi-eye-slash');
}
}
</script>
</body> </body>
</html> </html>

View File

@ -157,7 +157,7 @@
<div class="logo-circle"> <div class="logo-circle">
<img src="{{ asset('assets/logobaru.png') }}" alt="Logo"> <img src="{{ asset('assets/logobaru.png') }}" alt="Logo">
</div> </div>
<div class="main-title">Reset Password</div> <div class="main-title">Atur Ulang Kata Sandi</div>
<div class="sub-title">SMK Nasional Nganjuk</div> <div class="sub-title">SMK Nasional Nganjuk</div>
</div> </div>

View File

@ -157,7 +157,7 @@
<div class="logo-circle"> <div class="logo-circle">
<img src="{{ asset('assets/logobaru.png') }}" alt="Logo"> <img src="{{ asset('assets/logobaru.png') }}" alt="Logo">
</div> </div>
<div class="main-title">Reset Password</div> <div class="main-title">Lupa Kata Sandi</div>
<div class="sub-title">SMK Nasional Nganjuk</div> <div class="sub-title">SMK Nasional Nganjuk</div>
</div> </div>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="id">
<head> <head>
<meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="width=device-width, initial-scale=1.0" name="viewport">
@ -46,7 +46,7 @@
<nav class="header-nav ms-auto"> <nav class="header-nav ms-auto">
<a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown"> <a class="nav-link nav-profile d-flex align-items-center pe-3" href="#" data-bs-toggle="dropdown">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span> <span class="d-none d-md-block dropdown-toggle ps-2">{{ Auth::user()->name }}</span>
</a><!-- End Profile Iamge Icon --> </a><!-- End Profile Iamge Icon -->
@ -166,21 +166,21 @@
<li class="nav-item"> <li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" <button class="nav-link active" data-bs-toggle="tab"
data-bs-target="#profile-overview" type="button"> data-bs-target="#profile-overview" type="button">
Overview Ringkasan
</button> </button>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" <button class="nav-link" data-bs-toggle="tab"
data-bs-target="#profile-edit" type="button"> data-bs-target="#profile-edit" type="button">
Edit Profile Ubah Profil
</button> </button>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" <button class="nav-link" data-bs-toggle="tab"
data-bs-target="#profile-change-password" type="button"> data-bs-target="#profile-change-password" type="button">
Change Password Ubah Password
</button> </button>
</li> </li>
@ -192,13 +192,13 @@
<div class="tab-pane fade show active profile-overview" id="profile-overview"> <div class="tab-pane fade show active profile-overview" id="profile-overview">
<div class="card-body profile-card pt-4 d-flex flex-column align-items-center"> <div class="card-body profile-card pt-4 d-flex flex-column align-items-center">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}"
alt="Profile" class="rounded-circle"> alt="Profile" class="rounded-circle">
</div> </div>
<h5 class="card-title">Profile Details</h5> <h5 class="card-title">Detail Profil</h5>
<div class="row"> <div class="row">
<div class="col-lg-3 col-md-4 label ">Full Name</div> <div class="col-lg-3 col-md-4 label ">Nama Lengkap</div>
<div class="col-lg-9 col-md-8">{{ Auth::user()->name }}</div> <div class="col-lg-9 col-md-8">{{ Auth::user()->name }}</div>
</div> </div>
@ -221,10 +221,10 @@
@endif @endif
<div class="row mb-3"> <div class="row mb-3">
<label for="profileImage" class="col-md-4 col-lg-3 col-form-label">Profile <label for="profileImage" class="col-md-4 col-lg-3 col-form-label">Gambar
Image</label> Profil</label>
<div class="col-md-8 col-lg-9"> <div class="col-md-8 col-lg-9">
<img src="{{ Auth::user()->foto ? asset('storage/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" alt="Profile" width="120" class="rounded shadow"> <img src="{{ Auth::user()->foto ? asset('penyimpanan/' . Auth::user()->foto) : asset('assets/img/profile-img.jpg') }}" alt="Profile" width="120" class="rounded shadow">
<div class="pt-2"> <div class="pt-2">
<input type="file" class="form-control @error('foto') is-invalid @enderror" name="foto" id="foto" accept=".jpg,.jpeg,.png,.webp"> <input type="file" class="form-control @error('foto') is-invalid @enderror" name="foto" id="foto" accept=".jpg,.jpeg,.png,.webp">
@error('foto') @error('foto')
@ -235,8 +235,8 @@
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<label for="name" class="col-md-4 col-lg-3 col-form-label">Full <label for="name" class="col-md-4 col-lg-3 col-form-label">Nama
Name</label> Lengkap</label>
<div class="col-md-8 col-lg-9"> <div class="col-md-8 col-lg-9">
<input name="name" type="text" class="form-control @error('name') is-invalid @enderror" <input name="name" type="text" class="form-control @error('name') is-invalid @enderror"
id="name" value="{{ old('name', Auth::user()->name) }}" required> id="name" value="{{ old('name', Auth::user()->name) }}" required>
@ -277,7 +277,7 @@ class="col-md-4 col-lg-3 col-form-label">Email</label>
<div class="row mb-3"> <div class="row mb-3">
<label for="current_password" <label for="current_password"
class="col-md-4 col-lg-3 col-form-label">Current Password</label> class="col-md-4 col-lg-3 col-form-label">Password Saat Ini</label>
<div class="col-md-8 col-lg-9"> <div class="col-md-8 col-lg-9">
<input name="current_password" type="password" class="form-control @error('current_password') is-invalid @enderror" <input name="current_password" type="password" class="form-control @error('current_password') is-invalid @enderror"
id="current_password" required> id="current_password" required>
@ -288,8 +288,8 @@ class="col-md-4 col-lg-3 col-form-label">Current Password</label>
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<label for="password" class="col-md-4 col-lg-3 col-form-label">New <label for="password" class="col-md-4 col-lg-3 col-form-label">Password
Password</label> Baru</label>
<div class="col-md-8 col-lg-9"> <div class="col-md-8 col-lg-9">
<input name="password" type="password" class="form-control @error('password') is-invalid @enderror" <input name="password" type="password" class="form-control @error('password') is-invalid @enderror"
id="password" required> id="password" required>
@ -301,7 +301,7 @@ class="col-md-4 col-lg-3 col-form-label">Current Password</label>
<div class="row mb-3"> <div class="row mb-3">
<label for="password_confirmation" <label for="password_confirmation"
class="col-md-4 col-lg-3 col-form-label">Re-enter New Password</label> class="col-md-4 col-lg-3 col-form-label">Konfirmasi Password Baru</label>
<div class="col-md-8 col-lg-9"> <div class="col-md-8 col-lg-9">
<input name="password_confirmation" type="password" class="form-control" <input name="password_confirmation" type="password" class="form-control"
id="password_confirmation" required> id="password_confirmation" required>

View File

@ -292,7 +292,7 @@ class="bi bi-chevron-down toggle-dropdown"></i></a>
<div class="photo-backdrop"></div> <div class="photo-backdrop"></div>
<div class="photo-artistic-frame"> <div class="photo-artistic-frame">
@if ($kepala && $kepala->foto) @if ($kepala && $kepala->foto)
<img src="{{ asset('storage/' . $kepala->foto) }}" alt="{{ $kepala->nama }}"> <img src="{{ asset('penyimpanan/' . $kepala->foto) }}" alt="{{ $kepala->nama }}">
@else @else
<img src="{{ asset('assets/img/person/default.jpg') }}" alt="Default Foto"> <img src="{{ asset('assets/img/person/default.jpg') }}" alt="Default Foto">
@endif @endif
@ -364,7 +364,7 @@ class="bi bi-chevron-down toggle-dropdown"></i></a>
<div class="mt-5 pt-4 border-top"> <div class="mt-5 pt-4 border-top">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<img src="{{ $kepala->foto ? asset('storage/' . $kepala->foto) : asset('assets/img/person/default.jpg') }}" <img src="{{ $kepala->foto ? asset('penyimpanan/' . $kepala->foto) : asset('assets/img/person/default.jpg') }}"
alt="Foto" class="rounded-circle me-3" style="width: 60px; height: 60px; object-fit: cover;"> alt="Foto" class="rounded-circle me-3" style="width: 60px; height: 60px; object-fit: cover;">
<div> <div>
<h6 class="fw-bold mb-0">{{ $kepala->nama }}</h6> <h6 class="fw-bold mb-0">{{ $kepala->nama }}</h6>
@ -395,7 +395,7 @@ class="bi bi-chevron-down toggle-dropdown"></i></a>
<div class="col-lg-3 col-md-6" data-aos="fade-up" data-aos-delay="{{ $loop->index * 100 }}"> <div class="col-lg-3 col-md-6" data-aos="fade-up" data-aos-delay="{{ $loop->index * 100 }}">
<div class="ekstra-card"> <div class="ekstra-card">
<div class="ekstra-img-container"> <div class="ekstra-img-container">
<img src="{{ $item->foto ? asset('storage/' . $item->foto) : 'https://via.placeholder.com/400x250' }}" <img src="{{ $item->foto ? asset('penyimpanan/' . $item->foto) : 'https://via.placeholder.com/400x250' }}"
class="ekstra-img" alt="Foto {{ $item->nama_ekstrakurikuler }}"> class="ekstra-img" alt="Foto {{ $item->nama_ekstrakurikuler }}">
<div class="ekstra-overlay"> <div class="ekstra-overlay">
<span class="text-white small fw-bold">#SMKNasional</span> <span class="text-white small fw-bold">#SMKNasional</span>

View File

@ -106,7 +106,7 @@
<div class="col-lg-4 col-md-6" data-aos="fade-up" data-aos-delay="100"> <div class="col-lg-4 col-md-6" data-aos="fade-up" data-aos-delay="100">
<div class="feature-card h-100 d-flex flex-column p-0 border-0 shadow"> <div class="feature-card h-100 d-flex flex-column p-0 border-0 shadow">
<div style="height: 200px; overflow: hidden; position: relative;"> <div style="height: 200px; overflow: hidden; position: relative;">
<img src="{{ $berita->foto ? asset('storage/' . $berita->foto) : 'https://via.placeholder.com/400x250' }}" <img src="{{ $berita->foto ? asset('penyimpanan/' . $berita->foto) : 'https://via.placeholder.com/400x250' }}"
alt="{{ $berita->judul_lowongan }}" alt="{{ $berita->judul_lowongan }}"
style="width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;"> style="width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;">
</div> </div>

View File

@ -80,7 +80,7 @@
@forelse($fasilitas as $data) @forelse($fasilitas as $data)
<div class="col-md-6 col-lg-4" data-aos="fade-up" data-aos-delay="{{ $loop->iteration * 100 }}"> <div class="col-md-6 col-lg-4" data-aos="fade-up" data-aos-delay="{{ $loop->iteration * 100 }}">
<div class="feature-card"> <div class="feature-card">
<div class="feature-card-header" style="{{ $data->foto ? 'background: url('.asset('storage/' . $data->foto).') center/cover no-repeat; position: relative;' : '' }}"> <div class="feature-card-header" style="{{ $data->foto ? 'background: url('.asset('penyimpanan/' . $data->foto).') center/cover no-repeat; position: relative;' : '' }}">
@if($data->foto) @if($data->foto)
<div style="position: absolute; inset: 0; background: rgba(0,0,0,0.5);"></div> <div style="position: absolute; inset: 0; background: rgba(0,0,0,0.5);"></div>
@endif @endif

View File

@ -225,7 +225,7 @@ class="bi bi-chevron-down toggle-dropdown"></i></a>
<div class="teacher-card"> <div class="teacher-card">
<div class="teacher-top"> <div class="teacher-top">
@if ($item->foto) @if ($item->foto)
<img src="{{ asset('storage/' . $item->foto) }}" class="teacher-img" <img src="{{ asset('penyimpanan/' . $item->foto) }}" class="teacher-img"
alt="Foto {{ $item->nama }}"> alt="Foto {{ $item->nama }}">
@else @else
<img src="{{ asset('assets/img/person/default.jpg') }}" class="teacher-img" <img src="{{ asset('assets/img/person/default.jpg') }}" class="teacher-img"

View File

@ -264,7 +264,7 @@
<div class="col-lg-5" data-aos="fade-right"> <div class="col-lg-5" data-aos="fade-right">
<div class="photo-wrapper"> <div class="photo-wrapper">
@if($kepala->foto) @if($kepala->foto)
<img src="{{ asset('storage/'.$kepala->foto) }}" alt="{{ $kepala->nama }}"> <img src="{{ asset('penyimpanan/'.$kepala->foto) }}" alt="{{ $kepala->nama }}">
@else @else
<img src="{{ asset('assets/img/person/person-m-2.webp') }}" alt="Default Photo"> <img src="{{ asset('assets/img/person/person-m-2.webp') }}" alt="Default Photo">
@endif @endif

View File

@ -128,7 +128,7 @@
<div class="col-lg-6 mb-4"> <div class="col-lg-6 mb-4">
<div class="feature-card h-100 d-flex flex-column"> <div class="feature-card h-100 d-flex flex-column">
<!-- Custom Header for PPDB Card (Use Image if available, else generic) --> <!-- Custom Header for PPDB Card (Use Image if available, else generic) -->
<div class="feature-card-header" style="{{ $item->foto ? 'background: url('.asset('storage/' . $item->foto).') center/cover no-repeat; min-height: 200px;' : 'min-height: 150px;' }}"> <div class="feature-card-header" style="{{ $item->foto ? 'background: url('.asset('penyimpanan/' . $item->foto).') center/cover no-repeat; min-height: 200px;' : 'min-height: 150px;' }}">
@if($item->foto) @if($item->foto)
<div style="position: absolute; inset: 0; background: rgba(0,0,0,0.5);"></div> <div style="position: absolute; inset: 0; background: rgba(0,0,0,0.5);"></div>
@endif @endif

View File

@ -81,8 +81,8 @@
<div class="col-lg-10 text-center" data-aos="fade-up"> <div class="col-lg-10 text-center" data-aos="fade-up">
<div class="p-4 bg-white rounded shadow-sm"> <div class="p-4 bg-white rounded shadow-sm">
@if($strukturorganisasi && $strukturorganisasi->foto) @if($strukturorganisasi && $strukturorganisasi->foto)
<a href="{{ asset('storage/' . $strukturorganisasi->foto) }}" class="glightbox"> <a href="{{ asset('penyimpanan/' . $strukturorganisasi->foto) }}" class="glightbox">
<img src="{{ asset('storage/' . $strukturorganisasi->foto) }}" class="img-fluid rounded" alt="Struktur Organisasi" style="width: 100%;"> <img src="{{ asset('penyimpanan/' . $strukturorganisasi->foto) }}" class="img-fluid rounded" alt="Struktur Organisasi" style="width: 100%;">
</a> </a>
<p class="mt-3 text-muted fst-italic">Klik gambar untuk memperbesar</p> <p class="mt-3 text-muted fst-italic">Klik gambar untuk memperbesar</p>
@else @else

View File

@ -85,7 +85,7 @@
<div class="card border-0 shadow-sm rounded-4 overflow-hidden mb-4" data-aos="fade-up"> <div class="card border-0 shadow-sm rounded-4 overflow-hidden mb-4" data-aos="fade-up">
@if ($bkk->foto) @if ($bkk->foto)
<div style="max-height: 500px; overflow: hidden; position: relative;"> <div style="max-height: 500px; overflow: hidden; position: relative;">
<img src="{{ asset('storage/' . $bkk->foto) }}" class="img-fluid w-100" alt="{{ $bkk->judul_lowongan }}" style="object-fit: contain; background: #f8f9fa;"> <img src="{{ asset('penyimpanan/' . $bkk->foto) }}" class="img-fluid w-100" alt="{{ $bkk->judul_lowongan }}" style="object-fit: contain; background: #f8f9fa;">
</div> </div>
@endif @endif

View File

@ -60,7 +60,7 @@ class="bi bi-chevron-down toggle-dropdown"></i></a>
<div class="container text-center"> <div class="container text-center">
@if (isset($data->foto_struktur)) @if (isset($data->foto_struktur))
<div class="card border-0 shadow-lg rounded-4 overflow-hidden" data-aos="zoom-in"> <div class="card border-0 shadow-lg rounded-4 overflow-hidden" data-aos="zoom-in">
<img src="{{ asset('storage/' . $data->foto_struktur) }}" alt="Struktur Organisasi" <img src="{{ asset('penyimpanan/' . $data->foto_struktur) }}" alt="Struktur Organisasi"
class="img-fluid"> class="img-fluid">
</div> </div>
@else @else