Answer the question
In order to leave comments, you need to log in
How to get parameter from url in laravel?
There is a route:
Route::resource('/home/staff_doctor/patient/{patient}/passport', 'PassportController');
<a href="{{route('passport.index', ['id' => $patient->id])}}"
class="btn btn-success btn-xs">Добавить паспорт</a>
public function index($id)
{
$patient = Patient::find($id);
return view(route('passport.index'), compact('patient'));
}
<a href="{{route('passport.create', ['patient' => $patient->id])}}"
class="btn btn-success btn-xs">Добавить паспорт</a>
<a href="{{route('passport.index', ['patient' => $patient->id])}}"
class="btn btn-primary btn-xs">Посмотреть все</a>
public function index(Request $request)
{
$patient = Patient::find($request->patient);
return view(route('passport.index'), compact('patient'));
}
Answer the question
In order to leave comments, you need to log in
<a href="{{route('passport.index', ['patient' => $patient->id])}}"
class="btn btn-success btn-xs">Добавить паспорт</a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question