slampenny / smartseeder Goto Github PK
View Code? Open in Web Editor NEWA smart way of seeding tables in Laravel
A smart way of seeding tables in Laravel
I see there is a migration file set up for the seeds table. Why not use that instead of coding the table structure right in the SmartSeedRepository?
Publishing the migration to your app allows for easier automated deployments.
I'm creating a seeder this way:
php artisan seed:make test --env=sprint-7
but when I run:
php artisan seed:run --env=sprint-7
I get the following error:
[Symfony\Component\Debug\Exception\FatalErrorException] Illuminate\Filesystem\Filesystem::requireOnce(): Failed opening required '/vagrant/database/smartSeeds/seed_2016_12_31_0_PagesTableSeeder.php' (include_path='.:/usr/share/php:/usr/share/pear')
ps. I'm using the env parameter as a version instead of the real environment.
By default, the seed:run
command runs all the seed classes.
However, it would be useful to be able to use the --class
option to specify a specific seeder class to run individually. Much like the functionality provided by Laravel's out of the box seeding.
This could look something like:
php artisan seed:run --class=UserSeeder
or
php artisan seed:run --class=seed_2015_06_23_002940_UserSeeder
We intended on using this package for one of our main applications, but we need seeders to run in all environments and it seems like the logic currently limits seeders to a specific environment. This makes it difficult for us to populate all of our environments with the seeded data without duplicating code. Is there something in the documentation I'm missing that allows us to have "global" seeders?
Hi,
first of all big thank you for that package, this is what I'm looking for, but I see that after runing rollback nothink was changed in my db, the data is the same as before. So maybe seed classes should have two methods up and down like migrations has, so the developer can write what will happen when data is pushing to and pulling from db?
When I run php artisan migrate:refresh --seed the second time then integrity constraint violations are thrown because the data still exists in db even if I run seed:rollback or seed:reset
Is there any solution for that problem?
really nice package really easy way to create, run, install seeds i have check the code seeds path is define in config, can you add an option in package of providing path of the seed desire location, if that path options is not available then it can take config path. this will help other package developers to create new commands for creating seeds on other location they will call your commands with in their package commands no need to reinvent the wheel again,
There are no tests committed in this repo, so if someone wanted to contribute we couldn't run the tests.
This package is a great idea, but I am having issues getting it to work with production files.
With the --env=production
option, the package creates a seed file in the smartSeeds/production
directory. However when I use the seed:run
command, it does not find the file.
Based on what I am seeing it is looking for the file in the root directory.
/app/database/smartSeeds/someSeeder.php
I even tried running the command like so seed:make --env=production
but it's the same result.
Anyone else experiencing this? Any suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.