Search code examples
laravellaravel-artisan

How do I run artisan commands with parameters in route?


Running this code gives the expected result

Route::get('/make', function(){
 Artisan::call('make:mail',['name'=>'OrderShipped']);
});

I how ever want to add markdown to it. --markdown=emails.orders.shipped How do I add the markdown?


Solution

  • You should be able to do it like this:

    Artisan::call('make:mail', ['name' => 'OrderShipped', '--markdown' => 'emails.orders.shipped']);
    

    I hope it helps.