Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can one modify the templates created by artisan migrate command?

I've created a base class for my migrations. At the moment I run the artisan migrate command and it creates a new migration that extends the Migrations file, however I want to include my BaseMigration and extend it from there. I've been making this changes manualy but I feel like I'm repeating myself unnecessarily.

Any advice on how to have new migrations automatically extend and load my base migration?

like image 824
Moak Avatar asked Feb 16 '14 11:02

Moak


1 Answers

Since Laravel 7 you can publish stubs using php artisan stub:publish.

The published stubs will be located within a stubs directory in the root of your application. Any changes you make to these stubs will be reflected when you generate their corresponding classes using Artisan make commands.

like image 146
Alexey Ukolov Avatar answered Sep 24 '22 14:09

Alexey Ukolov