Download the PHP
package asvae/laravel-fixtures without Composer
On this page you can find all versions of the php package
asvae/laravel-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.
When working with database, sometimes we need to modify schema, and sometimes data. Doing both things in laravel migrations is painful. This package gives simple means to keep two of them separately.
Installation
Install via composer:
To your App\Console\Kernel add command like this:
Usage
For your fixtures be sure to extend\Asvae\LaravelFixtures\AbstractFixture class or at least implement Asvae\LaravelFixtures\FixtureContract. Abstract class has several utility methods to keep you going:
To run fixture do php artisan fixture:run "\App\Fixtures\YourFixture". This will basically run run method in given class, while also resolving dependencies in case you defined any in constructor.
Config
No config file provided as the library is way too small. You can define default namespace in .env file though. This will be used when you pass class name without namespace
Examples
Take a look at several examples. For the case depicted, in production, to fully migrate data you will run
In development, to refresh single table you will run solitary fixtures as these are much faster.
Hints
You can copy namespaced class name in PHPStorm by placing cursor onto class name and pressing Ctrl (⌘) + Shift + Alt + C
If you want to add some functionality, feel free to just copy package in your project. Several classes won't hurt.
Spread a word or leave a star if what I did was helpful for you.
All versions of laravel-fixtures with dependencies
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 asvae/laravel-fixtures contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.