I use encrypt. I can display all table data. However I can'T get one record. I don't encrypt 'id'. I tried another column but same.
Here is my error
Trying to get property 'id' of non-object
Here is my code
blade file (I click this link first )
<a href="one?id="></a>
blade file (display page I got error at this page)
@foreach ($data as $val)
@endforeach
Trying to get property 'id' of non-object
web.php
Route::get('/one','MailController@onerecord');
Route::post('/one','MailController@onerecord');
Controller
public function onerecord(Request $request)
{
$id = $request['id'];
$data = Contact::where('id',$id)->get();
return view('mail.one', ['data' => $data]);
}
Could you teach me what is wrong my code please?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire