1. Go to this page and download the library: Download dentro/laravel-patcher library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dentro / laravel-patcher example snippets
use Dentro\Patcher\Patch;
class WhatDoYouWantToPatch extends Patch
{
public function patch()
{
//
}
}
> $this->command->warn('i patch something danger!');
> $this->command->confirm('do you wish to continue?');
>
> [
> 'channels' => [
> 'patcher' => [
> 'driver' => 'patcher', // you can change me if you want
> 'path' => storage_path('logs/patches.log'), // change me
> ],
> ],
> ];
>
artisan patcher:run
use Dentro\Patcher\Patch;
use App\Models\User;
class WhatDoYouWantToPatch extends Patch
{
public function eligible(): bool
{
return User::query()->where('id', 331)->exists();
}
public function patch()
{
$user = User::query()->find(331);
// do something with user.
}
}
artisan patcher:run
class WhatDoYouWantToPatch extends Patch
{
public bool $isPerpetual = true;
}