Download the PHP package tobento/app-seeding without Composer

On this page you can find all versions of the php package tobento/app-seeding. 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 app-seeding

App Seeding

Seeding support for the app using the Seeder Service.

Table of Contents

Getting Started

Add the latest version of the app seeding project running this command.

Requirements

Documentation

App

Check out the App Skeleton if you are using the skeleton.

You may also check out the App to learn more about the app in general.

Seeding Boot

The seeding boot does the following:

The following seeders will be available:

Keep in mind that no Resources are set as they may be specific to your app needs. Therefore, the seeders mostly using the Lorem Seeder as fallback.

Adding Seed Resources

You may add seeder resources by the following ways:

Globally by using the app method

Specific on any service using the seed

Factories

Creating Factories

You may create seed factories for testing or other purposes.

To create a factory, create a class that extends the and configure your entity by using the method:

Creating entities

You may use the method to create specific entites using the definition. By default, a class will be created.

Storing entities

By default, entities will not be stored. You may use the method to store the entity based on the definition. In Addition, you may use method to get any service from the app container.

Using Factories

A factory can be created by calling the method on the factory class:

Make entities

The method creates an array of entities and returns them for further use in code, but does not store them in the database e.g.

Create entities

The method creates an array of entities, stores them in the database for instance and returns them for further use in the code.

Raw entities

The method creates an array of attributes from definition only and returns them for further use in code.

Modify definition

You may modify the definition by using the method:

You may use the method inside your factory class:

Modify entity

You may modify the entity by using the method:

You may use the method inside your factory class:

Seeders

You may create a seeder class to easily seed your application with test data.

Creating Seeders

To create a seeder, create a class that implements the :

If you want to seed millions of test data, using factories my not be the fastest solution. Instead you may directly use the storage if available which is much faster.

Example using the user repository from the App User bundle:

Adding Seeders

You may add seeders to be run by the app console using the app method.

Running Seeders

To run your added seeders use the console command.

Run only specific seeders by its name

Display seeded entities

You may display the seeded entities with the verbosity option:

List all seeder names

You may display the seeder names by using the console command.

User Seeding

If you have installed the User App bundle you may use the provided user factory and user seeder.

User Factory

User Seeder

Repository

You may easily create seed Repository Interface.

Creating Repository Factories

Using the repository factory

By using the method, you can quickly create a seed factory, which may be useful for testing purposes.

Storage Repositories with defined columns, will create the definition automatically based on the columns. You do not need to set a definition at all.

Check out the Using Factories section for more info using the factory in general.

Using the AbstractFactory

To create a factory, create a class that extends the and use the constant to define your repository class:

Sure, you may customize the definition for more flexibility:

Credits


All versions of app-seeding with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
tobento/app Version ^1.0.7
tobento/app-migration Version ^1.0
tobento/app-console Version ^1.0
tobento/service-seeder Version ^1.0.1
tobento/service-iterable Version ^1.0
tobento/service-support 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 tobento/app-seeding contains the following files

Loading the files please wait ....