1. Go to this page and download the library: Download dive-be/laravel-stateful library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dive-be / laravel-stateful example snippets
abstractclassCheckoutStateextendsState{
/* You can define which methods need to be implemented for each particular state.
* For example, you might want each state to have an associated view to resolve. */abstractpublicfunctionview(): string;
/* Like `view()`, each state should also have an associated index.
* We'll enforce that this method needs to be implemented by each class
* that inherits from this one. */abstractpublicfunctionstep(): int;
/* Set up which state transitions are allowed.
* This is
classAdvanceToShippingextendsTransition{
// omitted for brevitypublicfunctionafter(CheckoutWizard $wizard){
// run immediately after the transition
}
publicfunctionbefore(CheckoutWizard $wizard){
// run just before the transition
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.