Use laravel Eloquent find() method toi get a record by id in Laravel below is sample usage:
YourModal::find($id);
You can also use first method with where to get record in laravel by id.
YourModal::where('id',"=", $id)->first()
This post is submitted by one of our members. You may submit a new post here.
Laravel interview Questions © 2019 - Designed by PSD to HTML