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

Generate package migration file laravel 5.2 #29

Open
kraionz opened this issue Jan 8, 2016 · 4 comments
Open

Generate package migration file laravel 5.2 #29

kraionz opened this issue Jan 8, 2016 · 4 comments

Comments

@kraionz
Copy link

kraionz commented Jan 8, 2016

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

@kraionz kraionz changed the title Generate package migration file Generate package migration file laravel 5.2 Jan 8, 2016
@RichardLindhout
Copy link

@kraionz
Copy link
Author

kraionz commented Jan 8, 2016

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
Copy link

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
Copy link

  • vendor/amsgames/laravel-shop/src/Commands/MigrationCommand.php
  • vendor/amsgames/laravel-shop/src/Models/ShopItemModel.php
  • vendor/amsgames/laravel-shop/src/Traits/ShopCartTrait.php
  • vendor/amsgames/laravel-shop/src/Traits/ShopOrderTrait.php

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

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

No branches or pull requests

4 participants