Download the PHP package styde/seeder without Composer

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

Styde Seeder

This package for Laravel allow seeding your database with faker data. It is an alternative to Model Factories of Laravel 5.1. With this package you can seed a model of your application and its related models too, using the package Faker.

Installation

To install through Composer:

  1. Add the following instruction to the "require" object in your composer.json:

or simply execute on your console:

Then run composer update.

  1. After Styde Seeder is installed, you need to add the service provider to the providers array in config/app.php

  2. Then add the following to your database/seeds/DatabaseSeeder.php:

Specify the tables of database you want to $truncate (order does not matter since the foreign key check will be disabled) Then add the $seeders, by default it will autocomplete the suffix "TableSeeder" so no need to add it.

Usage

To create a new seeder file you can run:

And a new file called NameOfSeederTableSeeder.php will be created at database/seeds directory.

Then complete your seeder with new instance of the Model in the getModel() method and its attributes in the getDummyData method. You can use Faker for generates fake data, for example:

Completing the Model in getModel() and some attributes with faker data:

Once you run the seed command in Laravel php artisan db:seed it will create 50 users with random data by default.

Helpers

Also, you can use these two helpers when you are working with tests or php artisan tinker:

For example to create 5 users seed('User', 5) or to create one user with specific data seed('User', ['name' => 'John', 'email' => '[email protected]']).

With this helper you only can create an instance or collection, but will not be persisted to the database.

About

Styde Seeder was created by Duilio Palacios as part of the code for the course Crea tu primera aplicación con Laravel 5 (in Spanish)


All versions of seeder with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version 5.*
fzaninotto/faker Version 1.5.*@dev
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 styde/seeder contains the following files

Loading the files please wait ....