Download the PHP package garanaw/seedable-migrations without Composer

On this page you can find all versions of the php package garanaw/seedable-migrations. 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 seedable-migrations

Laravel Seedable Migrations

Tests Linting

About

Laravel provides a migration system with seeding. However, the seeding system is not very flexible. This package provides a more flexible way to seed your database with seed files linked to migrations.

You can run your seeding after each migration, or at the end of the batch. You can also specify seeder files that should run on the UP method or the DOWN method of your migrations.

Install

To install the package, run the following command:

After installing the package, you need to publish the migration stubs:

If you don't want to publish the stubs, you will need to extend your migrations manually from the Garanaw\SeedableMigrations\Migration class.

The new migration file

The migration files will look a bit different now when you run the command php artisan make:migration. The new migration files will look like this:

A few things to note here:

The new seeder file

The seeder files will look a bit different now when you run the command php artisan make:seeder. The new seeder files will look like this:

A few things to note here:

How to use

To run your migrations, you can use the php artisan migrate command as usual. The seeding will be done automatically.

To specify the seeder files associated to a migration, you will need to add some methods to the migration file:

The seedersUp() method is used to specify the seeder files that should run on the UP method of the migration. The seedersDown() method is used to specify the seeder files that should run on the DOWN method of the migration. None of them is mandatory. If you don't specify any seeder file, the seeder will not run.

Another optional method is the shouldSeed() method. This method is used to specify if the seeder should run or not. This method is useful if you want to run the seeder only on specific environments. The default implementation is:

Within the shouldSeed() method, you can use the app()->environment() method to check the environment, or any other logic to determine if the seeder should run or not.

To configure your seeder, you only need to add a configure() method to your seeder class:

Security Vulnerabilities

If you discover a security vulnerability, please create an issue using the issue tracker.

License

The Seedable Migrations library is open-sourced software licensed under the MIT license.


All versions of seedable-migrations with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2|^8.3
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 garanaw/seedable-migrations contains the following files

Loading the files please wait ....