diff --git a/app/Http/Controllers/Frontend/IndexController.php b/app/Http/Controllers/Frontend/IndexController.php index 03d470b..0477451 100644 --- a/app/Http/Controllers/Frontend/IndexController.php +++ b/app/Http/Controllers/Frontend/IndexController.php @@ -12,7 +12,7 @@ use App\Models\Jurusan; use App\Models\KategoriBerita; use App\Models\Kegiatan; -use App\Models\Pengajar; +use App\Models\User; use App\Models\Video; class IndexController extends Controller @@ -34,7 +34,7 @@ public function index() $video = Video::where('is_active','0')->first(); // Pengajar - $pengajar = Pengajar::with('user')->where('is_active','0')->get(); + $pengajar = User::with('userDetail')->where('status','Aktif')->where('role','Guru')->get(); // Berita $berita = Berita::where('is_active','0')->orderBy('created_at','desc')->get(); diff --git a/resources/views/frontend/content/guru.blade.php b/resources/views/frontend/content/guru.blade.php index 35cda9e..bfa5d0a 100644 --- a/resources/views/frontend/content/guru.blade.php +++ b/resources/views/frontend/content/guru.blade.php @@ -8,13 +8,13 @@
- team + team
-

{{$pengajars->user->name}}

- {{$pengajars->mengajar}} +

{{$pengajars->name}}

+ {{$pengajars->userDetail->mengajar}}
    -
  • +