Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How to define route in laravel?

# Defines a route that lists all the users using GET method
Route::get('users', 'UserController@show')->name('users');

# Defines a route that creates user using POST method
Route::post('/users', 'UserController@create');

# Defines a route that update user partially using PATCH method
Route::patch('/users/:id', 'UserController@update');

# Defines a route that deletes user using DELETE method
Route::delete('/users/:id', 'UserController@delete');
Source by learn2torials.com #
 
PREVIOUS NEXT
Tagged: #How #define #route
ADD COMMENT
Topic
Name
1+8 =