Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 484 Bytes

File metadata and controls

29 lines (28 loc) · 484 Bytes

Route with optional parameter

  1.  
      Route::get("user/{user_type?}");
      Route:post("user/{user_type?}");
      

Artisan commands with controller / routes

  1. Example : Run migration
    // in route 
    Route::get('/migration', function() {
     $output = [];
     Artisan::call('migrate', $output); 
    });
    
    OR
    // in controller 
    function index(){
     $output = [];
     Artisan::call('migrate', $output);
    }