Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php artisan migrate:make create_mytable fails: "migrate:make" is not defined

When running the following command at the root of my Laravel 5 application,

php artisan migrate:make create_mytable 

I get the following error:

[InvalidArgumentException]               Command "migrate:make" is not defined.   Did you mean one of these?               migrate:reset                        migrate:refresh                      migrate:status                       migrate:rollback                     migrate:install                      migrate    

Is there a new way to start migrations in Laravel 5?

like image 536
Jack Avatar asked Sep 15 '14 04:09

Jack


1 Answers

The syntax has changed to php artisan make:migration.

Here are the available make commands.

make:auth                    Create auth classes for the application make:console                 Create a new Artisan command make:controller              Create a new resource controller class make:filter                  Create a new route filter class make:migration               Create a new migration file make:provider                Create a new service provider class make:request                 Create a new form request class 

You can see a full list of commands by running php artisan list


You might also be ineterested in the Laravel Generators package.

To use it with Laravel 5, you'll need to require "way/generators": "~3.0"

It gives you the following additional commands:

generate:controller          Generate a controller generate:migration           Generate a new migration generate:model               Generate a model generate:pivot               Generate a pivot table generate:publish-templates   Copy generator templates for user modification generate:resource            Generate a new resource generate:scaffold            Scaffold a new resource (with boilerplate) generate:seed                Generate a database table seeder generate:view                Generate a view 
like image 66
Andy Fleming Avatar answered Oct 05 '22 17:10

Andy Fleming