Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel custom command not listed

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?

like image 698
maximus 69 Avatar asked Feb 06 '15 17:02

maximus 69


People also ask

What is custom command in Laravel?

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.

Which artisan command makes another artisan command?

To call another Artisan command and save its output you should use $this->call() from your command.

What is tinker in Laravel 8?

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.


2 Answers

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 :)

like image 181
A H Bensiali Avatar answered Sep 19 '22 14:09

A H Bensiali


From laravel version 5.6 onwards you need not make the entry of your custom command in app\Console\kernel.php

like image 21
YDF Avatar answered Sep 17 '22 14:09

YDF