Home >Backend Development >PHP Tutorial >Laravel how to delete migrate migration files through command

Laravel how to delete migrate migration files through command

WBOY
WBOYOriginal
2016-12-01 01:27:182135browse

Pass the command when creating migrate

<code>php artisan make:migration create_table_test</code>

The directory of the migration file will be added to the two files autoload_static.php and autoload_classmap.php.

Now every time I need to delete the migrate file of the above test table, in addition to deleting the migrate file itself, I also need to clear the directories where the migration files are added to the two files autoload_static.php and autoload_classmap.php.

Looking for the artisan command on the golaravel website, I did not find any information about automatically deleting migration files.

Question:
Is there any way to automatically delete migrate files through commands

Reply content:

Pass the command when creating migrate

<code>php artisan make:migration create_table_test</code>

The directory of the migration file will be added to the two files autoload_static.php and autoload_classmap.php.

Now every time I need to delete the migrate file of the above test table, in addition to deleting the migrate file itself, I also need to clear the directories where the migration files are added to the two files autoload_static.php and autoload_classmap.php.

Looking for the artisan command on the golaravel website, I did not find any information about automatically deleting migration files.

Question:
Is there any way to automatically delete migrate files through commands

Currently, laravel does not provide a command to automatically delete migration files;

But according to your question, you can delete the migration file and execute:

<code class="bash">composer dump-autoload</code>

Reset composer to automatically load files; saving you the trouble of manually deleting them!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn