In my Controller, I have
Route::getCurrentRoute()->getAction()[\'as\']
Everything works well in the browser but as soon as I type
You can use this code...
if(!App::runningInConsole()){ Route::getCurrentRoute()->getAction()['as']; }
when you run artisan command it will not get an error.