Home Laravel 9 Laravel 10 tutorial Search API

Laravel 10 tutorial Search API

1 min read
0
0
557

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.

 

Load More Related Articles
Load More By admin
Load More In Laravel 9

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Hotel Management System using Laravel 11

Relationships: Hotel ↔ Rooms (One-to-Many) A hotel can have many rooms, but a room belongs…