forked from jalameta/laravel-patcher
    
        
        - 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
Closed
Description
Example syntax
use Dentro\Patcher\Patch;
return new class extends Patch
{
    /**
     * Run patch script.
     *
     * @return void
     */
    public function patch(): void
    {
        //
    }
    
    public function eligible(): boolean
    {
        return false;
    }
};If eligible() method return false. the patch method will not be called. The output of console will seems like
Patching: 2020_10_09_124616_add_attachment_beep
Skipped: 2020_10_09_124616_add_attachment_beep is not eligible to run in current conditionThe reason why we need this :
Patches are often created because of some condition on certain environment, E.g. The staging environment database was broken due to some mistake by developer. But, other developer environments and production are not effected with the bug. So we only need to run this patch on staging environment and in other environments we still can run artisan patcher:run without worry about the error Model with id blablabla not found... that written in patch method.
Metadata
Metadata
Assignees
Labels
No labels