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

Name collision with Seed files #39

Open
akazorg opened this issue Feb 6, 2018 · 3 comments
Open

Name collision with Seed files #39

akazorg opened this issue Feb 6, 2018 · 3 comments
Labels

Comments

@akazorg
Copy link
Member

akazorg commented Feb 6, 2018

We cannot use Seed files using the same name of any of Voyager files, like DataRowsTableSeeder, PermissionsTableSeeder, etc., because they are being autoloaded from composer.

As result, when installing a Hook the system will use classes from the auloaded, missing the seeds located on the Hook folder.

This bug was hard to figure out, because install will run fine without any error message.

@akazorg akazorg added the bug label Feb 6, 2018
@fletch3555
Copy link
Member

We could namespace them, but that's not "standard" Laravel, and is hard to enforce in community-submitted hooks.

@marktopper
Copy link
Member

Yea, I think it would be a good idea to namespace them, but Laravel seeder does not support that by default, so will need to overwrite some code in the seeder script.
Once that is done I think we should just write a best practice about doing so, in order for the community to namespace their seeders in the hooks.

@marktopper marktopper changed the title bug | Name collision with Seed files Name collision with Seed files Feb 7, 2018
@fletch3555
Copy link
Member

Laravel's seeder should handle that just fine. You just have to call the class explicitly with the namespace

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

No branches or pull requests

3 participants