amsgames / laravel-shop

Laravel shop package
MIT License
483 stars 166 forks source link

Generate package migration file laravel 5.2 #29

Open kraionz opened 8 years ago

kraionz commented 8 years ago

i am new and I am following in the footsteps of laravel 5.1 to 5.2 php artisan laravel-shop:migration

after giving yes

creating migration... Symfony\Component\Debug\Exception\FatalErrorException Class name must be a valid object or a string

RichardLindhout commented 8 years ago

Maybe this link helps: https://laracasts.com/discuss/channels/general-discussion/laravel-5-database-migrate-help?page=1

kraionz commented 8 years ago

The problem is not to migrate, it is to try to build package migration file of laravel-shop. php artisan laravel-shop:migration

Thank you very much anyway

ideamanplatform commented 8 years ago

Kraionz in laravel 5.2 the 'auth.model' (for users) seems to have been changed to 'auth.providers.users.model'.

So what you might need to do is to open the MigrationCommand.php in vendor/amsgames/laravel-shop/src/Commands and locate the line

$userModel = Config::get('auth.model');

and replace it with $userModel = Config::get('auth.providers.users.model');

but you may encounter the following issue:

user_id_foreign foreign key (`user_id`) references `` (`id`) on delete cascade on update cascade)
Syntax error or access violation: 1103 Incorrect table name ''

at which point you can just open the migration that was generated and replace the empty single quotes with whatever name you have given the 'users' table...

That seems to have worked for me.

DigitalCoder commented 8 years ago

change this Config::get('auth.model') with Config::get('auth.providers.users.model')