Download the PHP package dentro/laravel-patcher without Composer
On this page you can find all versions of the php package dentro/laravel-patcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-patcher
Laravel Patcher
A (migration like) patcher for a smoldering production update.
Requirements:
- PHP : 8.*
- Laravel: 9.* / 10.* / 11.*
Installation
Do either of these methods below.
-
via shell
- adding
"dentro/laravel-patcher": "^1.0"
tocomposer.json
Post Installation
this process is optional, you can skip it though.
patches table creation.
Usage
Create New Patch
for creating a new patch, you need to run these following command
After run that command, you will see new file in patches
folder.
That file will be like:
Method patch
on this file will be filled with your logic.
in there is some useful properties
that you can use for supporting your patch such as:
$container: \Illuminate\Container\Container
-
$command: \Illuminate\Console\Command
we frequently used
$command
property to print process that we're doing. example:you can learn more about
\Illuminate\Console\Command
here. -
$logger: \Illuminate\Log\Logger
$logger
will store log instorage/logs/patches.log
. if you want to change it, add this line below in yourconfig/logging.php
in channels section.you can learn more about
\Illuminate\Log\Logger
hereShow Patch Status
Example:
Run Pending Patch(es)
Example:
Conditional Patch
You might need to skip single patch when run . Due to patch is unnecessary or patch is not eligible to run in your environment. Here you can add the method to your patch class to evaluate the condition before running the method.
then the output of will be:
Perpetual Patch
In some cases you might also want to run patches script indefinitely, you can change isPerpetual
property on your patch file to true
All versions of laravel-patcher with dependencies
illuminate/log Version ^9.0|^10.0|^11.0
illuminate/database Version ^9.0|^10.0|^11.0
illuminate/console Version ^9.0|^10.0|^11.0