I have created a custom command called confirmUserCommand
with the filename matching the class name (same case). The $name is set to confirmuser
.
Running the command php artisan list
displays the new command on my local, but not on the server (which is running linux). I did perform a composer dump-autoload and update the relevant composer files to no avail.
Any suggestions please?
Artisan is a frequently used command-line interface that comes with Laravel which provides a set of commands that are helpful while building your application. Let's say you want a command to automatically email getting started guide link to users 1 day after registration.
To call another Artisan command and save its output you should use $this->call() from your command.
Laravel Tinker allows you to interact with a database without creating the routes. Laravel tinker is used with a php artisan to create the objects or modify the data. The php artisan is a command-line interface that is available with a Laravel. Tinker is a command tool that works with a php artisan.
Laravel 5.2 ~ 5.5:
Create your command & edit
protected $signature = 'order:check'; //or whatever you want your command to be
You will have to find where the commands are created & edit the app\Console\kernel.php
file.
in this file under
protected $commands = [
\App\Console\Commands\OrderCheck::class,
]
run again
php artisan list
It should be listed there :)
From laravel version 5.6 onwards you need not make the entry of your custom command in app\Console\kernel.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With