1.

Explain Laravel routing

Answer»

Laravel route helps to build SEO friendly request URL. Most BASIC Laravel route accepts 2 parameters i.e. URI and closure.

Route::GET('hello', function () {    return 'Hello World'; });

All Laravel routes are DEFINED in route file in routes directory. For web interface routes will be defined in routes/web.php whereas the routes in routes/api.php are stateless and are assigned the api middleware group.  

AVAILABLE Route Methods

Route::get($uri, $callback); Route::post($uri, $callback); Route::PUT($uri, $callback); Route::patch($uri, $callback); Route::delete($uri, $callback); Route::options($uri, $callback);


Discussion

No Comment Found