antonioribeiro / firewall

Firewall package for Laravel applications
BSD 3-Clause "New" or "Revised" License
1.39k stars 163 forks source link

Error on Migrate:Refresh --Seed #4

Closed alexhernandez closed 10 years ago

alexhernandez commented 10 years ago

When using firewall if I run:

php artisan migrate:refresh --seed

I get a Symfony error. My guess is because firewall doesn't keep its migration file inside laravels migration folder, but instead inside its own vendor folder.

$ php artisan migrate:refresh --seed
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to undefined method PragmaRX\\Firewall\\Vendor\\Laravel\\Facade::down()","file":"\/Users\/Alex\/Sandbox\/01_projects\/lla\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/Migrator.php","line":197}}

Any idea how I can get this to work?

antonioribeiro commented 10 years ago

I agree there is a consensus on copying migrations to the app migrations folder, but Firewall does migrations is the old way Laravel folks were doing:

php artisan migrate --package=pragmarx/firewall

To undo it, you have to

php artisan migrate:rollback --package=pragmarx/firewall

Unfortunately refresh will not work in this case.

antonioribeiro commented 10 years ago

And, still, I'm not sure it will work, I remember talking with Taylor about rollback not having the --package option...

antonioribeiro commented 10 years ago

So your best bet may be just delete all tables manually, since this is exactly what refresh will do for you.

alexhernandez commented 10 years ago

I tried rollback and your right it doesn't work. I get this error:

 [RuntimeException]
  The "--package" option does not exist.

What if i were to duplicate your migration file into my migration folder?

alexhernandez commented 10 years ago
Call to undefined method PragmaRX\\Firewall\\Vendor\\Laravel\\Facade::down()

Seems to be the issue.

antonioribeiro commented 10 years ago

It should work. Comment the Firewall alias in your app/config/app.php, looks like PHP was also refering to the wrong class when trying to run the migration.

antonioribeiro commented 10 years ago

As soon as I get some time here I'll change the way it does migrations.

alexhernandez commented 10 years ago

muito obrigado

antonioribeiro commented 10 years ago

De nada. :)

antonioribeiro commented 10 years ago

I just pushed a new way of doing migrations. Check the readme, please.

alexhernandez commented 10 years ago

Sounds good. Thanks.

alexhernandez commented 10 years ago

Just tested it, it works. Thanks.

One thing you forgot was to add firewall:tables to your docs instead of tracker:tables

screen_shot_2014-06-16_at_8_22_01_am

antonioribeiro commented 10 years ago

Fixed. Thanks.