Download the PHP package gbhorwood/pollinate without Composer
On this page you can find all versions of the php package gbhorwood/pollinate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gbhorwood/pollinate
More information about gbhorwood/pollinate
Files in gbhorwood/pollinate
Package pollinate
Short Description Artisan command to create seed files from the database
License MIT
Informations about the package pollinate
Pollinate
Pollinate is a command for artisan
for use in Laravel projects that creates database seed files from your database. If you have data in a database and want to turn it into seeds, pollinate is here. Pollinate was developed as an internal-use tool for fruitbat studios/cloverhitch technologies/kludgetastic implementations.
Install
Install via composer
Prerequisites
Pollinate requires the following:
- PHP 7.4 or higher
- The
pdo
extension - The composer package
doctrine/dbal
Usage
The simplest usage of pollinate is:
This will create seed files for all the tables in your database, and all seed files and classnames will be prefixed with the default pollinate_
prefix.
note: some tables are automatically excluded from pollinations, such as passport tables and job tables. these are defined in the script in the ignoreTables
array.
pollinating specific tables
If you only wish to create seed files for specified tables, you can provide a comma-separated list of table names as an argument:
ignored tables
Some tables are preset to not bet pollinated. These are tables for things like passport or jobs. You can dump a list of ignored tables with
If you explicitly name a table in the tables list, it will be pollinated even if it is in the ignored list
specifying a prefix
By default, pollinate prefixes all seed file and class names with pollinate_
. You can specify your own prefix with the --prefix=
option:
this will create seed files and classes with names like mydevbox_Pets.php
.
overwriting existing seed files
Pollinate's default behaviour is to not overwrite existing seed files. If one or more seed files exist that would be overwritten, pollinate will error and quit before doing any work.
If you wish to override this behaviour so that existing seed files are overwritten, you can pass the --overwrite
option:
missing or empty tables
Pollinate does not write seed files for missing or empty tables.
output
All non-error output can be suppressed by passing the --silent
option.
If output is not suppressed, pollinate will output a list of classes that can be pasted into your DatabaseSeeder.php
file.