Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

Commit

Permalink
creating route and function for display doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
FauzanAr committed Apr 11, 2019
1 parent e11a5ae commit d4f9cfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/DoctorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public function show($id)
return view('listDoctor')->with('data',$data);
}

public function showDoctor($id)
{
$doctor = Doctor::find($id);

return view('viewDoctor')->with('doctor',$doctor);
}
/**
* Show the form for editing the specified resource.
*
Expand Down
4 changes: 2 additions & 2 deletions resources/views/SearchDokter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@
</div>
</div>
</div>
@foreach($data['specialization'] as $specialty)
<div class="row">
@foreach($data['specialization'] as $specialty)
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img src="{{ asset('storage/images/iconrad.png') }}" alt="{{$specialty->name}}" class="img-thumbnail" >
<a href="{{route('list.doctorSpecialty', ['specialty' => $specialty->id])}}" class="btn btn-primary">{{$specialty->name}}</a>
</div>
</div>
</div>
@endforeach
</div>
<a type="button" class="btn btn-primary " href="{{route('list.doctor')}}">Lihat Semua</a>


Expand Down
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
// });

Route::get('/listdoctors/{specialty}', 'DoctorController@show')->name('list.doctorSpecialty');
Route::get('/listdoctors/viewdoctor/{id}', 'DoctorController@showDoctor')->name('show.doctor');

Route::get('/viewhospital', function() {
return view('viewhospital');
Expand Down

0 comments on commit d4f9cfb

Please sign in to comment.