Download the PHP package singlequote/laravel-model-seeder without Composer

On this page you can find all versions of the php package singlequote/laravel-model-seeder. 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-model-seeder

Laravel Model Seeder

Create seeders from your model using the data in your database

This package will generate automatic seeders using your models. It supports pivot relations to automatic sync relations in pivot tables with your models.

Latest Version on Packagist Total Downloads

Installation

Usage

The package has a single command line with a few options. The command below will generate seeders using laravels default folder structure. The seeders will be created in database/seeders and your models should be in App\Models

Model events

By default laravel adds the WithoutModelEvents trait to your seeders. The package does this also for abious reasons. If you would like to use your model events, you can add the --with-events option to the command.

Changing the package behaviour

If you moved your models to another location or you renamed your Models folder to something else you can change this in the config of the package.

Publish config

Using the command you can publish the config and edit it.

The default content of the config file is:

Changing model location and seeder output

You can change your models location using the config or using the --path option from your command line. For example if you are using modules in your package and you want to create seeders for your module.

Seeder output location

The package will try to detect the output directory by checking the folder structure of your project and look for the database folder.

If you changed this and the package can't detect the output path you can give the output path as a option with the command.

Auto retrieve all models

If you have multiple model locations and want to make seeders of them all. You can use the --path=auto option. This option will import all declared classes and check if they extend the Model::class.

Exclude models

By default the package will create seeders for every model in the given path. You can use the --only=.. option to exclude other models from the process.

Order seed data on column

By default the package will generate the data ordering by the id column. you can change this using the orderBy option.

Or order by desc

Contributing

Please see CONTRIBUTING for details.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Quotec, Traktieweg 8c 8304 BA, Emmeloord, Netherlands.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-model-seeder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version >=9
stichoza/google-translate-php Version ^4.1
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 singlequote/laravel-model-seeder contains the following files

Loading the files please wait ....