Download the PHP package naoray/laravel-factory-prefill without Composer

On this page you can find all versions of the php package naoray/laravel-factory-prefill. 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-factory-prefill

laravel-factory-prefill

Total Downloads Build Status

This repository has been archived! Use Shift's Factory Generator to utilize the new class factories of Laravel 8.

Factories are a great concept and I really love to use them for testing purposes, but it sucks to write every needed column name and associated faker methods by hand. This package aims to make the process less painful by providing a command to prefill your factories!

After creating a factory with the artisan cli you end up having something like this:

With laravel-factory-prefill you can just skip the previous command call and instead execute php artisan factory:prefill Habit.

factory:prefill

Install

composer require naoray/laravel-factory-prefill --dev

Usage

After running php artisan migrate you are good to go. If you want the factory:prefill command to notice the model relations, you should implement the methods first!

Tip: If you also want the realtionships to be loaded automatically, you have to define the methods in the models.

Fill all Factories

To generate factories for all models run

php artisan factory:all

Models in different directories

To prefill factories from models outside of the app/ directory just add the -P flag and provide the path.

php artisan factory:all --path=Some/Other/Path

you can also append the --realpath option to indicate that the given path is a pre-resolved absolut path.

Fill single Factory

To fill a single factory you can either run php artisan factory:prefill model_name or php artisan factory:all model_name.

Models with different namespace

To prefill factories from models outside of the App/ namespace just add the -O flag and provide the full path in the model name.

php artisan factory:prefill "Some\Other\Namespace\ModelName" -O

Nullable columns

By default nullable columns are ignored. If you want to also add nullable columns to your factory includ the flag -N or --allow-nullable.

php artisan factory:prefill ModelName -N or php artisan factory:all -N

Testing

Run the tests with:

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

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


All versions of laravel-factory-prefill with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^6.0|^7.0
fzaninotto/faker Version ~1.4
naoray/eloquent-model-analyzer Version ^1.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 naoray/laravel-factory-prefill contains the following files

Loading the files please wait ....