PHP code example of karriere / state
1. Go to this page and download the library: Download karriere/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/ */
karriere / state example snippets
'providers' => [
...
Karriere\State\StateServiceProvider::class,
...
];
$state = $stateFactory->build('state-name', ['key' => 'value']);
$store->put($state);
// pass on $state->identifier()
$state = $store->get($identifier);
if(!$state->isEmpty()) {
// use either $state->collection() or $state->raw() to access the state data
}
php artisan vendor:publish