Questions tagged [laravel-console]
8 questions
1
vote
1 answer
How to abort or stop code in laravel-zero when i have multiple task?
I have multiple laravel-zero task like this, how to stop all task below if task A false condition?
$this->task("Task A", function () {
if (!condition) {
return false;
exit;
die;
}
});
$this->task("Task B", function () {
return…

Vieri Lusen
- 65
- 8
1
vote
2 answers
laravel 7 artisan key:generate not working
when i run php artisan key:generate in cmd it's return
file_get_contents(/project/positiv/core/vendor/psy//.env): failed to open stream: No such file or…

Joynal Abedin
- 67
- 8
1
vote
1 answer
How to load custom .env file in Laravel console command?
I have this console command code:
class MyCommand extends Command
{
protected $signature = 'custom:mycommand {domain}';
// ...
public function handle()
{
$domain = $this->argument('domain');
// read domain based…

netdjw
- 5,419
- 21
- 88
- 162
0
votes
1 answer
Where does the console command save exported file
I'm using Laravel 5.8 and I tried creating a custom command like this:
php artisan make:command app exportappresults
And the Command goes like this:
protected $signature = 'app:exportappresults';
protected $description = 'Export App Exam Result…

Pouya
- 114
- 1
- 8
- 36
0
votes
1 answer
Laravel console table with column width
I have just discovered the table rendering function in Laravel console command.
My project is built on Laravel 5.8, but even if there is an answer for more advanced versions it will be great to know.
I am looking for rendering a table with…

guyaloni
- 4,972
- 5
- 52
- 92
0
votes
2 answers
laravel command php artisan make:model run all commands in Commands folder
Why php artisan run all commands in the folder Commands when I create a model for example ?
Did I made something wrong ?

Eloise85
- 648
- 1
- 6
- 26
0
votes
0 answers
How to make laravel document root different from the returned value of public_path function
I have a new laravel 8 installation which I have changed the index directory to the based_path() directory.
That is the root folder of fresh laravel installation.
Now whenever I run
php artisan serve
It says that the $_SERVER['DOCUMENT_ROOT'] is the…

Emmanuel David
- 410
- 7
- 17
0
votes
0 answers
Laravel: pass data to view in "console command"
I'm using Laravel blades/views to generate files by templates from the custom console command. Unfortunately, any of the variants from official documentation are not working.
This is how I'm trying to pass data to the view:
$info = 'Some…

Vlad Rovner
- 194
- 4
- 11