Download the PHP package riley19280/persistent-seeders without Composer

On this page you can find all versions of the php package riley19280/persistent-seeders. 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 persistent-seeders

GitHub Workflow Status (master) Total Downloads Latest Version License

Persistent Seeders

Persistent Seeders allow you to easily maintain your seeded data in a central location, and ensures that your data only gets inserted once.

A prime use case for this is for Roles. At the start of an application, you probably have a few roles that you want to support

As development continues, you realize that you need more roles. The usual process for this would be to update your regular seeder, and also manually write a migration to insert the new role, and then run it in production. However, with Persistent Seeders this entire process can be automated. All you need to do is add a new function in the same file! It now looks like this:

When the seeder runs again, only the new Manager role will be created. No messing with migrations, no searching for other roles that exist. Just a straightforward understanding of your applications' data.

Installation

You can install the package via composer:

And then publish the migrations

Usage

Create a new database seeder and extend from PersistentSeeders\PersistentSeeder.

Then create your seed function, and add the SeederId attribute to the method. This attribute marks the method as a seeder, and relies on the uuid passed to it to prevent duplicate runs. If this id changes, the function will be run again.

Extra Configuration

By default, the record of seed function run is stored in the seeders table. If you would like to change that location, you can publish the config file and change the table_name property.

Production Usage

This package is perfectly suited for production usage, even though you may be hesitant to run "seeders" in production.

The most straightforward approach is to create a ProductionSeeder class as a regular seeder, and then run it as part of your deploy process.

Alternatively, you can run each individually


All versions of persistent-seeders with dependencies

PHP Build Version
Package Version
Requires illuminate/conditionable Version ^11
illuminate/macroable Version ^11
illuminate/database Version ^11
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 riley19280/persistent-seeders contains the following files

Loading the files please wait ....