In this will teach you how to use the search criteria using Laravel 10 using restful API.i already done the Crud application using Laravel if you are not watch them please watch them here. you will learn the crud application in Laravel from scratch.
First Step we have to defined the route path
Route::get('/search/{id}',[EmployeeController::class, 'search']);
After that in the EmployeeController class have to create function seach.
EmployeeController
function search($id) { $employee = Employee::where('id',$id)->get(); return response()->json( $employee); }
I have attached the video link below. which will do this tutorials step by step.