[ 'model' => \Crm\Coupon\Models\Coupon::class, 'table' => 'crm_coupon_coupons', 'hidden'=> [], 'visible' => [], 'guarded' => ['*'], 'slugs' => ['slug' => 'name'], 'dates' => ['deleted_at', 'created_at', 'updated_at'], 'appends' => [], 'fillable' => ['user_id', 'code', 'start_date', 'end_date', 'discount_amount', 'discount_percentage', 'Image', 'max_users', 'used_count', 'status', 'details', 'user_type'], 'translatables' => [], 'upload_folder' => 'coupon/coupon', 'uploads' => [ /* 'images' => [ 'count' => 10, 'type' => 'image', ], 'file' => [ 'count' => 1, 'type' => 'file', ], */ ], 'casts' => [ 'marking' => 'array', /* 'images' => 'array', 'file' => 'array', */ ], 'revision' => [], 'perPage' => '20', 'search' => [ 'name' => 'like', 'status', ] ], 'search' => [ ], 'list' => [ [ "key" => "code", "type" => "text", "label" => 'coupon::coupon.label.code', 'sort' => true, 'roles' => [], ], [ "key" => "start_date", "type" => "text", "label" => 'coupon::coupon.label.start_date', 'sort' => true, 'roles' => [], ], [ "key" => "end_date", "type" => "text", "label" => 'coupon::coupon.label.end_date', 'sort' => true, 'roles' => [], ], [ "key" => "discount_amount", "type" => "text", "label" => 'coupon::coupon.label.discount_amount', 'sort' => true, 'roles' => [], ], [ "key" => "discount_percentage", "type" => "text", "label" => 'coupon::coupon.label.discount_percentage', 'sort' => true, 'roles' => [], ], [ "key" => "Image", "type" => "text", "label" => 'coupon::coupon.label.Image', 'sort' => true, 'roles' => [], ], [ "key" => "max_users", "type" => "text", "label" => 'coupon::coupon.label.max_users', 'sort' => true, 'roles' => [], ], [ "key" => "used_count", "type" => "text", "label" => 'coupon::coupon.label.used_count', 'sort' => true, 'roles' => [], ], [ "key" => "details", "type" => "text", "label" => 'coupon::coupon.label.details', 'sort' => true, 'roles' => [], ], ], 'form' => [ [ "key" => 'code', "element" => 'text', "type" => 'text', "label" => 'coupon::coupon.label.code', "placeholder" => 'coupon::coupon.placeholder.code', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'start_date', "element" => 'date_picker', "type" => 'date_picker', "label" => 'coupon::coupon.label.start_date', "placeholder" => 'coupon::coupon.placeholder.start_date', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'end_date', "element" => 'date_picker', "type" => 'date_picker', "label" => 'coupon::coupon.label.end_date', "placeholder" => 'coupon::coupon.placeholder.end_date', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'discount_amount', "element" => 'numeric', "type" => 'numeric', "label" => 'coupon::coupon.label.discount_amount', "placeholder" => 'coupon::coupon.placeholder.discount_amount', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'discount_percentage', "element" => 'numeric', "type" => 'numeric', "label" => 'coupon::coupon.label.discount_percentage', "placeholder" => 'coupon::coupon.placeholder.discount_percentage', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'Image', "element" => 'text', "type" => 'text', "label" => 'coupon::coupon.label.Image', "placeholder" => 'coupon::coupon.placeholder.Image', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'max_users', "element" => 'numeric', "type" => 'numeric', "label" => 'coupon::coupon.label.max_users', "placeholder" => 'coupon::coupon.placeholder.max_users', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'used_count', "element" => 'numeric', "type" => 'numeric', "label" => 'coupon::coupon.label.used_count', "placeholder" => 'coupon::coupon.placeholder.used_count', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'details', "element" => 'text', "type" => 'text', "label" => 'coupon::coupon.label.details', "placeholder" => 'coupon::coupon.placeholder.details', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], ], 'urls' => [ 'new' => [ 'url' => 'coupon/coupon/new', 'method' => 'GET', ], 'create' => [ 'url' => 'coupon/coupon/create', 'method' => 'GET', ], 'store' => [ 'url' => 'coupon/coupon', 'method' => 'POST', ], 'update' => [ 'url' => 'coupon/coupon', 'method' => 'PUT', ], 'list' => [ 'url' => 'coupon/coupon', 'method' => 'GET', ], 'delete' => [ 'url' => 'coupon/coupon', 'method' => 'DELETE', ], ], 'order' => [ 'created_at' => 'coupon::coupon.label.created_at', 'name' => 'coupon::coupon.label.name', 'status' => 'coupon::coupon.label.status', ], 'groups' => [ [ 'icon' => "mdi:account-supervisor-outline", 'name' => "coupon::coupon.groups.main", 'group' => "main.main", 'title' => "coupon::coupon.groups.main", ], [ 'icon' => "fe:home", 'name' => "coupon::coupon.groups.details", 'group' => "main.details", 'title' => "coupon::coupon.groups.details", ], 'images' => [ 'icon' => "fe:home", 'name' => "coupon::coupon.groups.images", 'group' => "main.images", 'title' => "coupon::coupon.groups.images", ], 'settings' => [ 'icon' => "fe:home", 'name' => "coupon::coupon.groups.settings", 'group' => "main.settings", 'title' => "coupon::coupon.groups.settings", ] ], 'controller' => [ 'provider' => 'Crm', 'package' => 'Coupon', 'module' => 'Coupon', ], 'workflow' => [ 'type' => 'workflow', 'marking_store' => [ 'type' => 'multiple_state', 'arguments' => ['status'], // 'property' => 'status' ], 'supports' => [ \Crm\Coupon\Models\Coupon::class, ], 'places' => [ 'Draft', 'Pending', 'Approved', 'Closed', 'Published', 'Archived', 'Unpublished', ], 'initial_places' => ['Draft'], 'transitions' => [ 'submit' => [ 'from' => 'Draft', 'to' => 'Pending', 'metadata' => [ 'roles' => [ 'user' => ['*'], ], 'rules' => [ 'name' => 'required', ] ], ], 'reject' => [ 'from' => 'Pending', 'to' => 'Draft', 'metadata' => [ 'roles' => [ 'user' => ['superuser'], 'team' => ['admin', 'manager'], ], 'form' => [ 'title' => 'Reject', 'button' => [ 'cancel' > [ 'icon' > '', 'varient' > '', 'label' > 'Cancel' ], 'submit' > [ 'icon' > '', 'varient' > 'primary', 'label' > 'Reject' ] ], 'fields' => [ 'count' => [ "element" => 'select', "type" => 'select', "label" => 'advert::advert.label.count', "placeholder" => 'advert::advert.placeholder.count', "options" => call_user_func(function () { return [ 1 => ['value' => 1, 'text' => 1], 2 => ['value' => 2, 'text' => 2], 3 => ['value' => 3, 'text' => 3], 4 => ['value' => 4, 'text' => 4], ]; }), "col" => "12", ], 'comment' => [ "element" => 'textarea', "type" => 'text', "required" => 'required', "label" => 'advert::advert.label.comment', "placeholder" => 'advert::advert.placeholder.comment', "col" => "12", ], ], ], ], ], 'approve' => [ 'from' => 'Pending', 'to' => 'Approved', 'metadata' => [ 'roles' => [ 'user' => ['superuser'], 'team' => ['admin', 'manager'], ] ], ], 'publish' => [ 'from' => ['Approved', 'Unpublished'], 'to' => 'Published', 'metadata' => [ 'roles' => [ 'user' => ['superuser'], 'team' => ['admin'], ] ], ], 'unpublish' => [ 'from' => ['Published'], 'to' => 'Unpublished', 'metadata' => [ 'roles' => [ 'user' => ['superuser', 'admin'], 'team' => ['admin'], ] ], ], 'archive' => [ 'from' => ['Published', 'Unpublished'], 'to' => 'Archived', 'metadata' => [ 'roles' => [ 'user' => ['superuser', 'admin'], 'team' => ['admin'], ] ], ], 'unarchive' => [ 'from' => ['Archived'], 'to' => 'Draft', 'metadata' => [ 'roles' => [ 'user' => ['superuser', 'admin'], 'team' => ['admin'], ] ], ], ], ], 'actions' => [ 'copy' => [ 'type' => ['Details', 'List'], 'label' => 'coupon::coupon.action.copy', 'roles' => [ 'user' => ['superuser', 'admin'], 'team' => ['admin'], 'permission' => ['coupon.coupon.copy', 'coupon.coupon.duplicate'], ], 'form' => [ 'count' => [ "element" => 'select', "type" => 'select', "label" => 'coupon::coupon.label.count', "placeholder" => 'coupon::coupon.placeholder.count', "options" => call_user_func(function () { return [ 1 => ['value' => 1, 'text' => 1], 2 => ['value' => 2, 'text' => 2], 3 => ['value' => 3, 'text' => 3], 4 => ['value' => 4, 'text' => 4], ]; }), "col" => "12", ], 'comment' => [ "element" => 'textarea', "type" => 'text', "required" => 'required', "label" => 'coupon::coupon.label.comment', "placeholder" => 'coupon::coupon.placeholder.comment', "col" => "12", ], ], ], 'empty' => [ 'type' => ['List', 'Details'], 'label' => 'coupon::coupon.action.empty', 'roles' => [ 'user' => ['superuser'], ], ], 'section' => [ 'type' => ['Group'], 'api_url' => '', 'action' => 'list', 'label' => 'coupon::coupon.action.section', 'store' => 'main.units', 'group' => 'main.units' ], ] ];