Package stuff was removed. View stuff remains afaik, but other than that nothing.
So how resolve the problem ? Thanks.
Wait for taylor to re-add the package code or to update the docs to tell us how packages should be done. Any package that uses package() will fail (Which is pretty much all of them). Nothing to do but wait I'm afraid.
Package stuff was removed.
This means it is not being re-added. So waiting for Taylor to add it back is only going to waste your time.
There is currently no way to manage it. You can't even use the --path option.
I'm really hoping these options come back because frankly, it's a kick in the gut to packages that like to automate install processes for users. I've tried numerous options to get migrations going, and the best I could come up with was to copy your package migrations into the migrations folder in the app.
What's even worse, however - is if you have some sort of migration setup specific to your tests - there is currently no way to make them work, at all.
I truly believe that the only things that need to be fixed before a Beta tag in L5 is this issue and also the global CSRF filter (or an easy work-around for calls which CSRF should not be applied)
I got it. Just now.
In your packages, you need to do something like this:
$migrations = $this->app->make('migration.repository'); $migrations->createRepository(); $migrator = $this->app->make('migrator'); $migrator->run(__DIR__.'/../src/migrations'); $migrator->run(__DIR__.'/Fixtures/Migrations');
I'm running this inside a custom command right now, called shift:migrate.
It ensures the migrations table is there, and then runs through the migrations necessary for the package, and the migrations I've setup for the full test suite.
And here's a gist: https://gist.github.com/kirkbushell/6d425001ef9599dbdc92
I think that the better way right know is to create a command name
install:package and inside it to run all migration, publish files, etc.
In your documentation just tell users to specify the migration path
./artisan migrate --path=vendor/rtconner/laravel-tagging/migrations
Or you could publish your migrations in your ServiceProvider's boot method
$this->publishes([ realpath(__DIR__.'/path/to/migrations') => $this->app->databasePath().'/migrations', ]);
Once a user calls
vendor:publish the migration files will be moved and he'll be able to run
migrate with your migrations included.
^ yup, this is now the preferred and documented method.
I tried the above approach. Once i publish the package and run composer dump-autoload, i am getting the below error.
Generating autoload files Warning: Ambiguous class resolution, "xyz" was found in both "<first_file_path>" and "<Second_file_path>", the first will be used.
If i run migrate command, exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Cannot redeclare class XYZ'
How to resolve this.
Thanks in advance.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.