Download the PHP package tyghaykal/laravel-seed-generator without Composer

On this page you can find all versions of the php package tyghaykal/laravel-seed-generator. 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-generator

Laravel Seeder Generator

Test CI Latest Stable Version Total Downloads Latest Unstable Version License

Generate laravel seeder file from a real data from your database.

Supported Database

Version Compatibility

Laravel Version
11.x ^2.0.*
10.x ^2.0.*
9.x ^2.0.*
8.x ^2.0.*
7.x ^2.0.*
6.x ^2.0.*
5.8.x ^2.0.*
5.7.x & before Not tested

Install

Laravel Setup

Laravel will automatically register the service provider for you, so no more step on this.

You can generate a config file to personalize this package using vendor:publish and choose TYGHaykal\LaravelSeedGenerator\SeedGeneratorServiceProvider.

In the config file, you can adjust some of settings on generating seeders file such as namespace, prefix, suffix, and connection.

Usage

Options

Option Description
--show-prompt Show menu in prompt
--mode= Set the source mode (model or table)
--table-mode Set the source mode into table
--model-mode Set the source mode into model
--models= Generate seed for selected model, can be multiple separated with comma
--tables= Generate seed for selected table, can be multiple separated with comma
--all-tables Generate seed for all tables
--where-raw-query=rawQuery Select data with Raw Query clause
--where=field,type,value Select data with where clause
--where-in=field,value1,value2 Select data with where in clause
--where-not-in=field,value1,value2 Select data with where not in clause
--order-by=field,type(asc,desc) Order data to be seeded
--limit=int limit seeded data, value must be integer
--all-ids Seed All ids
--ids="id1,id2" The ids to be seeded, cannot be used simultaneously with --ignore-ids
--ignore-ids="id1,id2" The ids to be ignored, cannot be used simultaneously with --ids
--all-fields Seed All fields
--fields="field1,field2" The fields to be seeded, cannot be used simultaneously with --ignore-fields
--ignore-fields="field1,field2" The fields to be ignored, cannot be used simultaneously with --fields
--without-relations Seed All data without relations, only on model mode
--relations="relation1,relation2" The relation to be seeded, must be function name of has many relation, only on model mode
--relations-limit=int Limit relation data to be seeded, value must be integer, only on model mode
--output The location of seeder file
--no-seed Skip include the database seeder file

Usage on Model with Option

Just set the model value with your model Namespace without \App\Models or \App or your defined namespace on config.php, for example your model namespace is under \App\Models\Master\Type, so you just need type Master\Type. Can be multiple and separated with comma.

You can run the command and show the menu using

You can filter which data will be included into seeder file using where clause

You can filter which data will be included into seeder file using where in clause

You can filter which data will not be included into seeder file using where not in clause

You can order the data will be included into seeder file using order-by clause

You can limit the data will be included into seeder file using limit clause

You can also define which data you want to include to seeder file based on the id with, can only run with single model only:

Or you want to skip some ids:

You can also define which field that you want include to seeder file based on the field name with:

Or you want skip some fields:

You can also define which hasMany relation that you want seed, only has effect on model mode with single model only:

You can also limit the relation that you want seed, only has effect on model mode with single model only:

You can also change the location of generated seeder file:

By default, every generated seeders file will be presented on DatabaseSeeder.php, if you don't want it, you can use --no-seed option:

Usage on Table with Option

Just set the tables value as table name, can be multiple separated with comma

You can run the command and show the menu using

You can filter which data will be included into seeder file using where clause

You can filter which data will be included into seeder file using where in clause

You can filter which data will not be included into seeder file using where not in clause

You can order the data will be included into seeder file using order-by clause

You can limit the data will be included into seeder file using limit clause

You can also define which data you want to include to seeder file based on the id with:

Or you want to skip some ids:

You can also define which field that you want include to seeder file based on the field name with:

Or you want skip some fields:

You can also change the location of generated seeder file:

By default, every generated seeders file will be presented on DatabaseSeeder.php, if you don't want it, you can use --no-seed option:


All versions of laravel-seed-generator with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
laravel/framework Version 5.8.*|6.*|7.*|8.*|9.*|10.*|11.*
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 tyghaykal/laravel-seed-generator contains the following files

Loading the files please wait ....