I`m new to the laravel 5.4.what i want to do is when i press the See Here green color button,All the details need to be shown in new view called seedetails.blade.php according to relevant Trainee_ID.for an example if i press MOB/TR 1741 See details button all the data in the database need to shown only according to that ID. see the interface .
relevant view for that view.
<table class="table table-striped">
<thead>
<th>Trainee ID</th>
<th>Name with Initials</th>
<th>Working Division</th>
<th>Starting Date</th>
<th>Ending Date</th>
<th>See All the Details<</th>
</thead>
<tbody>
@foreach($items as $item)
<tr>
<td>{{ $item->trainee_id }}</td>
<td>{{ $item->name_with_initials }}</td>
<td>{{ $item->trainee_division }}</td>
<td>{{ $item->start_date }}</td>
<td>{{ $item->end_date }}</td>
<td>
<a class="btn btn-success" href="Seedetails/{{ $item->traninee_id }}">See Here</a>
</td>
</tr>
@endforeach
</tbody>
</table>
Here is the necessary controller for retrive data according to trainee_id
public function user_details($traninee_id)
{
$trainee_details= registerdetails::where('id','=',$traninee_id)->get()->first();
return view('registeredusers.seedetails', compact('trainee_details'));
}
Here is the seedetails.blade.php which should retrieve the data and shown.which is linked to above view`s see button ,see the code.
`<div class="panel panel-default">
<div class="panel-body">
<div class="col-md-6 col-md-offset-3">
<table class="table table-bordered">
<tbody>
<tr>
<td>Full Name</td>
<td>{{ $item->full_name }}</td>
</tr>
<tr>
<td>Nic No</td>
<td>{{ $item->nic_no }}</td>
</tr>
<tr>
<td>Date Of Birth</td>
<td>{{ $item->date_of_birth }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Here is the Route for that view
Route::get('Seedetails/{id}', 'UserRegisterController@user_details');
Then this is the error now um getting when i press the See details button.