diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index ad747df869ccc82454cd798f351bce00403f14de..c50e4d2b20fa6cc2b058faf5938523677b5974b3 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -42,7 +42,12 @@ class HomeController extends Controller $enrolled[] = DB::table('courses')->where('id', $id)->first(); } - return view('home', ['profile' => $profile, 'role' => $role, 'courses' => $courses, 'enrolled' => $enrolled]); + $image = 'student.png'; + if (Auth::user()->role == 1) { + $image = 'lecturer.png'; + } + + return view('home', ['image' => $image, 'profile' => $profile, 'role' => $role, 'courses' => $courses, 'enrolled' => $enrolled]); } /** diff --git a/public/img/course1.png b/public/img/course.png similarity index 100% rename from public/img/course1.png rename to public/img/course.png diff --git a/public/img/course2.png b/public/img/course2.png deleted file mode 100644 index 5835f1b9e122b187fbd4b757753464059c69e091..0000000000000000000000000000000000000000 Binary files a/public/img/course2.png and /dev/null differ diff --git a/public/img/lecturer.png b/public/img/lecturer.png new file mode 100644 index 0000000000000000000000000000000000000000..d6bc7ddf41334b5efac85d2f8acb1691ab3a07b1 Binary files /dev/null and b/public/img/lecturer.png differ diff --git a/public/img/profile.jpg b/public/img/profile.jpg deleted file mode 100644 index c9d2de1809454045034632e4c766d4b11c3c0ee2..0000000000000000000000000000000000000000 Binary files a/public/img/profile.jpg and /dev/null differ diff --git a/public/img/student.png b/public/img/student.png new file mode 100644 index 0000000000000000000000000000000000000000..93885b8b734e43e8a7ba7f37d8f88245fffe6ae5 Binary files /dev/null and b/public/img/student.png differ diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 05cce0a1a1937756bab01cc50df620660f5c8d17..6e5db735f59e1f56f28cb8861fd2356b8622c131 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -50,7 +50,7 @@ @endif @foreach($enrolled as $enroll) <div class="card course" style="width: 14rem"> - <img src="img/course1.png" class="card-img-top" alt="No Picture"> + <img src="img/course.png" class="card-img-top" alt="No Picture"> <div class="card-header">{{ $enroll->name }}</div> <a href="/course/<?php echo $enroll->id; ?>" class="stretched-link"></a> </div> @@ -97,7 +97,7 @@ <div class="card"> <div class="card-header"><b>Profil</b></div> <div class="card-body profile"> - <img src="img/profile.jpg" style="width:120px;height:120px;" alt="No Picture"> <br/> <br/> + <img src="img/{{ $image }}" style="width:120px;height:120px;" alt="No Picture"> <br/> <a id="profile-name">{{ $profile->name }}</a> <br/> <a id="email">{{ $profile->email }}</a> <br/> <a id="role">{{ $role }}</a> <br/><br/>