Download the PHP package mayconbordin/l5-fixtures without Composer

On this page you can find all versions of the php package mayconbordin/l5-fixtures. 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 l5-fixtures

l5-fixtures

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Fixtures package for Laravel 5 with support for JSON, CSV, YAML and PHP files.

If you are seeding your database with fake data that can be easily generated, consider using the Model Factories.

But if you need to load data that can't be generated then this is your best choice.

Installation

In order to install Laravel 5 Fixtures, just add

to your composer.json. Then run composer install or composer update.

Then in your config/app.php add

in the providers array and

to the aliases array.

If you are using Laravel 5.5, package will be automatically discovered, no need to edit config/app.php

Configuration

To publish the configuration for this package execute php artisan vendor:publish and a fixtures.php file will be created in your app/config directory.

Usage

By default the fixtures directory is /fixtures, inside it you should place the data files that will fill the database. The name of the file should be exactly the same as the name of the database table (e.g.: 'table_one.json'). Take a look at the two examples in the /tests_data directory.

To apply all fixtures to the database run

If you only want to apply some fixtures, you can pass an array with the name of the fixtures you want to apply

And to destroy the records in the database run

The down method can also receive an array with the name of fixtures that will be destroyed. Currently all records in the database tables are destroyed.

If you haven't published the configuration file or you want to load fixtures from another location, you only need to execute the following code before applying the fixtures:

Data Format

The fixtures files are parsed in order to create an array of records that are themselves associative arrays. The resulting array is then inserted in the database using the insert method of the query builder.

Relations are not handled by the library, but you can make reference to other records by their IDs, even if they haven't been inserted yet because the library disables the foreign key checks before inserting the fixtures into the database.

JSON

CSV

The delimiter is detected automatically.

YAML

PHP


All versions of l5-fixtures with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version 5.x
illuminate/database Version 5.x
illuminate/console Version 5.x
league/csv Version ~8.0.0
symfony/yaml Version ~2.8.2
league/flysystem Version ~1.0.16
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 mayconbordin/l5-fixtures contains the following files

Loading the files please wait ....