laravel service provider check if running from artisan code example Example: laravel app running in console app()->runningInConsole()