Download the PHP package touhidurabir/laravel-seed-extender without Composer

On this page you can find all versions of the php package touhidurabir/laravel-seed-extender. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-seed-extender

Laravel Seed Extender

A highly opinioned way to work with the laravel seeder.

Installation

Require the package using composer:

WHY ?

As mentioned, this is a highly opinioned way to work with seeder. We have popular Faker library and Model Factories to seed model table and that seems like the obious choice . But sometimes in production or even in the development purpose we need real life data to seed model table and for that purpose need seeder classes .

Now this package does not introduce any new mechanism of the seeding using the seeder classes but just add some ability to manupulate the each seeder class as per need . Basically it add some extar feature/ability to the seeder class.

Usage

To generate a new seeder class of this package, run the following command

That will generate an seeder new seeder class at the /database/seeders location . for example , a basic user seeder class will look like this

As the above example showes, there are few properties that can be modified manually or vai the command.

Class properties and methods explanation

$table (PROPERTY)

It define for which talbel it will run the seeder . to specify which table vai the command

NOTE that if the $table property not passed , it will set the default table name as just table_name which need to be updated as per target seeding table

$ignorables (PROPERTY)

It defined which columns will be ignored at the seed time . it specify which columns we want to ignore at the class generation time through the command, provide comma seperated columns name

$useables (PROPERTY)

It defined which columns will be used at the seed time . it specify which columns we want to use at the class generation time through the command, provide comma seperated columns name

NOTE that if the $useables property and defined and not empty, it will take account of it and ignore the set values of $ignorables property.

$includeTimestampsOnSeeding (PROPERTY)

This defined if the created_at and updated_at values will be auto included at the seed time. by default this is set to true . but if the model is not using the timestamp values or do not want to include it in the seding process, then specify it through the command at the time of generation

$model (PROPERTY)

This define the table associated model. Only use this one when want to run the seeding process through eloquent model class .

NOTE that is the $model property defined, the console seeding process will use the model class to run the seeding process .

set the option -model with proper model class will full namespace in the command to specify that you want to have the seeding process to use the eloquent model class .

$quietly (PROPERTY)

This define if the model events should fire or not when running the seeding process via eloquent model . buy default it's set to TRUE so that when seeding process will run via model class, no model eents will fire as most of the time we do not want to have our observers(if registered) to perform action at the seed time . Set it to FALSE to make the sure that model events will fiew at the seed time if seeding through eloquent model .

use the flag --with-events in the command to specify that you want to have the model events to fire at seeding time .

$data (PROPERTY)

This defined what data to seed . for example

seedableDataBuilder (METHOD)

If we have some data that needed to be presetent to every seeding rows, then it's better to not to have the as repetitive data in the $data properties and define those in this method .

More Command Options

replace

By default it will throw exception and print a error message in the console when a seeder class of same name already exists but if needed to replace it pass the flag --replace

strict

By default this package will not try to validate the give informaitons like table name it useables or ignorables columns but if required to , it can validate those via passing the flag --strict .

Run seeding independent of seeder class

This package provides way to run a seeding process independent of seeder class . That is one can run a seeding process from within the app at the runtime .

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT


All versions of laravel-seed-extender with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
illuminate/database Version ^8.54||^9.0||^10.0||^11.0
touhidurabir/laravel-stub-generator Version ^1.0
illuminate/support Version ^8.54||^9.0||^10.0||^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package touhidurabir/laravel-seed-extender contains the following files

Loading the files please wait ....