Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Add set/get accessors for MigrationCreator stubPath #26489

Closed
wants to merge 1 commit into from

Conversation

hastinbe
Copy link

Very straight-forward, makes the stub path mutable so we can use our own stubs. This is beneficial for those who want different schemas than the defaults with the migration commands. For one example, I want increments() over bigIncrements() (#26472) without having to change it with each migration

Example usage from a service provider:

$this->app->extend('migration.creator', function ($creator, $app) {
    return tap($creator)->setStubPath(__DIR__.'/../../database/migrations/stubs');
});

Signed-off-by: Beau Hastings <beausy@gmail.com>
@driesvints driesvints changed the title Add set/get accessors for MigrationCreator stubPath [5.8] Add set/get accessors for MigrationCreator stubPath Nov 13, 2018
@taylorotwell
Copy link
Member

I think I would rather have a more comprehensive solution to overriding stubs.

@hastinbe
Copy link
Author

I agree that would be nice, but if you search this you'll see people have been wanting to change the stub path since Laravel 4.2. They are stuck with solutions like overriding MigrationCreator and replacing laravel's in the service container, using composer scripts to overwrite the stubs in the vendor directory, and custom artisan commands. Just to change the stub path. I hope you reconsider that this is just a small change that fulfills a simple need until a more comprehensive solution becomes available. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants