PHP code example of regnerisch / laravel-command-hooks

1. Go to this page and download the library: Download regnerisch/laravel-command-hooks 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/ */

    

regnerisch / laravel-command-hooks example snippets


use \Regnerisch\LaravelCommandHooks\Command;

class MyCustomCommand extends Command
{
    protected function before(): ?int
    {
        // Do something before the command
        
        return $code;
    }
    
    protected function after(int $code): ?int
    {
        // Do something after the command
        
        return $code;
    }
    
    // ...
}