Download the PHP package simone-bianco/laravel-patches without Composer

On this page you can find all versions of the php package simone-bianco/laravel-patches. 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-patches

Laravel Data Patches

This package provides a migration-like system for incremental Laravel data changes. It is designed for data that should be ordered, replayable, reversible, and easier to review than a large monolithic seeder.

Use it for:

Installation

Publishing creates:

Configuration

config/sb-patches.php can define global hooks around patch execution and rollback. Each hook must be a fully qualified class with an __invoke method.

Patch formats

The package supports two executable patch formats under database/patches.

1. Classic file patch

This is best for small data changes where the full patch fits cleanly in one file.

2. Module patch directory

The runner executes only patch.php. Any other file inside the module directory is support material and is ignored by discovery, even if it is PHP.

Module patches are the recommended format for substantial seed data. Keep patch.php focused on behavior and put large arrays, JSON payloads, localized copy, source maps, or helper data next to it.

Identifiers and order

Patch identifiers are normalized paths relative to database/patches.

Classic file:

identifier:

Module patch:

identifier:

Execution order is alphabetical/natural by identifier. This keeps ordering based on names and timestamp prefixes, regardless of whether a patch is a direct file or a module directory.

A duplicate classic/module identifier is invalid. For example, these two cannot coexist:

Creating patches

Create a classic patch file:

Create a module patch directory:

Create a module patch with an empty data.php file:

--data implies --module.

Patch structure

A patch returns an anonymous class extending Patch.

For module patches, patch.php may read local support files.

Applying patches

Run all pending patches:

Limit the number of applied patches:

The runner discovers executable entries only:

Non-timestamped PHP files and module support files are ignored.

Forcing a single patch

Run one patch by identifier without recording it in sb_patches:

This resolves both classic and module formats. It is useful for compatibility seeders and explicit replay/debug checks, not for normal deploy tracking.

Rolling back patches

Roll back the last batch:

Roll back a number of recently applied patches:

Roll back every applied patch:

Rollback in production asks for confirmation. Use --force only in controlled deployment scripts.

Re-apply from scratch:

Using the facade

Seeder best practices

Large seeders should be split into patch modules rather than kept as one huge seeder class.

Recommended split examples:

Keep each patch responsible for one reversible concern. Avoid broad deletes, truncates, or unrelated data cleanup inside seed patches.

Testing

License

The MIT License (MIT). Please see the license file for more information.


All versions of laravel-patches with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
illuminate/support Version ^12.0
illuminate/validation Version ^12.0
illuminate/console Version ^12.0
illuminate/cache Version ^12.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 simone-bianco/laravel-patches contains the following files

Loading the files please wait ...