Sunday, May 16, 2021

how to define a route ??

 locate the route file web.php in side the route directory of the project 


Basic Route which returns a value 

Route::get('/greeting', function () {
    return 'good morning';
});
output on the browser


Basic Route which returns a view  
Route::get('/greeting', function () {
    return view ('greeting');
});
To return a view we need to create  a view first other wise it throw an error view not found
 To create a view locate the view folder and create a file greeting.blade.php 




 
Response on the browser



No comments:

Post a Comment

Call Factory and make multiple record entry Using tinker

  $d = Factory(App\Department::class,3)->create(); > $d = Factory(App\Department::class, 10)->create(); = Illuminate\Database\Eloqu...