Download the PHP package davidvandertuijn/laravel-after-seeders without Composer

On this page you can find all versions of the php package davidvandertuijn/laravel-after-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 laravel-after-seeders

Laravel After Seeders

Total Downloads Latest Stable Version License

Laravel After Seeders

This library adds seeder functionality with versioning support for Laravel, making it ideal for a production environment. Seeders are stored in the database/after_seeders directory in JSON format. The execution progress of each seeder is tracked in the after_seeders table, ensuring that each seeder is only seed once.

Install

Install the package via Composer:

Run the migrations:

Publish the configuration file:

Usage

Create a New Seeder Automatically

Use the command below to create a complete seeder based on existing records in a database table.

The command will prompt you to include or exclude specific columns from the table. If you skip a column, it won’t be included in the seeder file. You can also define a range of record IDs to include.

Example prompt:

After completion, you’ll get the following message:

And the seeder will look like this:

Create a New Seeder Manually

Use the following command to create an empty “after seeder” file. This option is ideal if you’re already familiar with the JSON structure and prefer to manually input the data.

You’ll see the following output upon success:

A basic structure for the JSON file will look like this:

If you use Navicat for MySQL, it follows the same format when exporting data to a .json file.

Running Seeders

To execute pending “after seeders,” run the following command:

The command checks whether the specified table and columns exist. If not, the seeder will be skipped.

After completion, you’ll get the following message:


Handling created_at

If the table has a created_at column and it’s missing from the seeder, the current timestamp will be automatically inserted.

Update Or Insert

If the seeder contains an id column, the updateOrInsert method will be used. Otherwise, the insert method will be applied.

Tags

You can use tags to organize and manage your seeders more effectively. By adding a tag, you can group seeders and seed specific groups when needed.

Create a Seeder with a Tag

To generate a seeder based on existing records and assign a tag, use the --tag option:

Similarly, you can create an empty seeder and assign a tag:

Running Seeders by Tag

When running seeders, you can specify a tag to seed only the seeders that belong to that group:

This allows you to selectively execute seeders based on tags, making it easier to control which seeders are applied in different environments or scenarios.

Deployment

When deploying your application, you can execute seeders with specific tags using the deployment command. Before doing this, you’ll need to define the tags in your project’s configuration file located at config/after_seeders.php.

To run the seeders during deployment, simply use the following command:


All versions of laravel-after-seeders with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
php Version >=8.0.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 davidvandertuijn/laravel-after-seeders contains the following files

Loading the files please wait ....