1. Go to this page and download the library: Download lastdino/approval-flow 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/ */
lastdino / approval-flow example snippets
return [
/**
* This is the name of the table that contains the roles used to classify users
* (for spatie-laravel-permissions it is the `roles` table
*/
'roles_model' => "\\Spatie\\Permission\\Models\\Role",
/**
* The model associated with login and authentication
*/
'users_model' => "\\App\\Models\\User",
/*
|--------------------------------------------------------------------------
| Routes Configuration
|--------------------------------------------------------------------------
*/
'routes' => [
'prefix' => 'flow',
'middleware' => ['web'],
'guards' => ['web'],
],
/*
|--------------------------------------------------------------------------
| Date and Time Configuration
|--------------------------------------------------------------------------
*/
'datetime' => [
'formats' => [
'default' => 'Y-m-d H:i:s',
'date' => 'Y-m-d',
'time' => 'H:i:s',
'year_month' => 'Y-m',
],
],
/**
* User Display Configuration
*/
'user' => [
'display_name_column' => 'Full_name',
'fallback_columns' => ['full_name', 'display_name','name'],
],
];
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Lastdino\ApprovalFlow\Traits\HasApprovalFlow;
class Document extends Model
{
use HasApprovalFlow;
// モデルの実装
}