PHP code example of exabyssus / laravel-finite-state

1. Go to this page and download the library: Download exabyssus/laravel-finite-state 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/ */

    

exabyssus / laravel-finite-state example snippets


php artisan vendor:publish --provider="Exabyssus\StateMachine\StateMachineServiceProvider"   

config/state-machine.php

function beforeStateChange($transition, $stateFrom, $stateTo)

function afterStateChange($transition, $stateTo)