[ 'model' => \Litecms\Account\Models\Invoice::class, 'table' => 'litecms_account_invoices', 'hidden'=> [], 'visible' => [], 'guarded' => ['*'], 'slugs' => ['slug' => 'name'], 'dates' => ['deleted_at', 'created_at', 'updated_at'], 'appends' => [], 'fillable' => ['type', 'ref', 'user_id', 'invoicable_id', 'invoicable_type', 'invoice_date', 'remarks', 'items', 'grand_total', 'agency_amount', 'discount', 'due_amount', 'due_date', 'invoice_status', 'contact_type', 'notes', 'documents'], 'translatables' => [], 'upload_folder' => 'account/invoice', '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" => "type", "type" => "text", "label" => 'account::invoice.label.type', 'sort' => true, 'roles' => [], ], [ "key" => "ref", "type" => "text", "label" => 'account::invoice.label.ref', 'sort' => true, 'roles' => [], ], [ "key" => "invoicable_id", "type" => "text", "label" => 'account::invoice.label.invoicable_id', 'sort' => true, 'roles' => [], ], [ "key" => "invoicable_type", "type" => "text", "label" => 'account::invoice.label.invoicable_type', 'sort' => true, 'roles' => [], ], [ "key" => "invoice_date", "type" => "text", "label" => 'account::invoice.label.invoice_date', 'sort' => true, 'roles' => [], ], [ "key" => "remarks", "type" => "text", "label" => 'account::invoice.label.remarks', 'sort' => true, 'roles' => [], ], [ "key" => "grand_total", "type" => "text", "label" => 'account::invoice.label.grand_total', 'sort' => true, 'roles' => [], ], [ "key" => "agency_amount", "type" => "text", "label" => 'account::invoice.label.agency_amount', 'sort' => true, 'roles' => [], ], [ "key" => "discount", "type" => "text", "label" => 'account::invoice.label.discount', 'sort' => true, 'roles' => [], ], [ "key" => "due_amount", "type" => "text", "label" => 'account::invoice.label.due_amount', 'sort' => true, 'roles' => [], ], [ "key" => "due_date", "type" => "text", "label" => 'account::invoice.label.due_date', 'sort' => true, 'roles' => [], ], [ "key" => "invoice_status", "type" => "text", "label" => 'account::invoice.label.invoice_status', 'sort' => true, 'roles' => [], ], [ "key" => "contact_type", "type" => "text", "label" => 'account::invoice.label.contact_type', 'sort' => true, 'roles' => [], ], ], 'form' => [ [ "key" => 'type', "element" => 'radios', "type" => 'radios', "label" => 'account::invoice.label.type', "placeholder" => 'account::invoice.placeholder.type', "rules" => '', "options" => function(){ return trans('account::invoice.options.type'); }, "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'ref', "element" => 'text', "type" => 'text', "label" => 'account::invoice.label.ref', "placeholder" => 'account::invoice.placeholder.ref', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'invoicable_id', "element" => 'numeric', "type" => 'numeric', "label" => 'account::invoice.label.invoicable_id', "placeholder" => 'account::invoice.placeholder.invoicable_id', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'invoicable_type', "element" => 'text', "type" => 'text', "label" => 'account::invoice.label.invoicable_type', "placeholder" => 'account::invoice.placeholder.invoicable_type', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'invoice_date', "element" => 'date_picker', "type" => 'date_picker', "label" => 'account::invoice.label.invoice_date', "placeholder" => 'account::invoice.placeholder.invoice_date', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'remarks', "element" => 'text', "type" => 'text', "label" => 'account::invoice.label.remarks', "placeholder" => 'account::invoice.placeholder.remarks', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'items', "element" => 'html_editor', "type" => 'html_editor', "label" => 'account::invoice.label.items', "placeholder" => 'account::invoice.placeholder.items', "rules" => '', "group" => "main.main", "col" => "12", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'grand_total', "element" => 'decimal', "type" => 'decimal', "label" => 'account::invoice.label.grand_total', "placeholder" => 'account::invoice.placeholder.grand_total', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'agency_amount', "element" => 'decimal', "type" => 'decimal', "label" => 'account::invoice.label.agency_amount', "placeholder" => 'account::invoice.placeholder.agency_amount', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'discount', "element" => 'decimal', "type" => 'decimal', "label" => 'account::invoice.label.discount', "placeholder" => 'account::invoice.placeholder.discount', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'due_amount', "element" => 'numeric', "type" => 'numeric', "label" => 'account::invoice.label.due_amount', "placeholder" => 'account::invoice.placeholder.due_amount', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'due_date', "element" => 'date_picker', "type" => 'date_picker', "label" => 'account::invoice.label.due_date', "placeholder" => 'account::invoice.placeholder.due_date', "rules" => '', "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'invoice_status', "element" => 'radios', "type" => 'radios', "label" => 'account::invoice.label.invoice_status', "placeholder" => 'account::invoice.placeholder.invoice_status', "rules" => '', "options" => function(){ return trans('account::invoice.options.invoice_status'); }, "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'contact_type', "element" => 'radios', "type" => 'radios', "label" => 'account::invoice.label.contact_type', "placeholder" => 'account::invoice.placeholder.contact_type', "rules" => '', "options" => function(){ return trans('account::invoice.options.contact_type'); }, "group" => "main.main", "col" => "6", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'notes', "element" => 'html_editor', "type" => 'html_editor', "label" => 'account::invoice.label.notes', "placeholder" => 'account::invoice.placeholder.notes', "rules" => '', "group" => "main.main", "col" => "12", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], [ "key" => 'documents', "element" => 'html_editor', "type" => 'html_editor', "label" => 'account::invoice.label.documents', "placeholder" => 'account::invoice.placeholder.documents', "rules" => '', "group" => "main.main", "col" => "12", "append" => null, "prepend" => null, "roles" => [], "attributes" => [ 'wrapper' => [], "label" => [], "element" => [], ], ], ], 'urls' => [ 'new' => [ 'url' => 'account/invoice/new', 'method' => 'GET', ], 'create' => [ 'url' => 'account/invoice/create', 'method' => 'GET', ], 'store' => [ 'url' => 'account/invoice', 'method' => 'POST', ], 'update' => [ 'url' => 'account/invoice', 'method' => 'PUT', ], 'list' => [ 'url' => 'account/invoice', 'method' => 'GET', ], 'delete' => [ 'url' => 'account/invoice', 'method' => 'DELETE', ], ], 'order' => [ 'created_at' => 'account::invoice.label.created_at', 'name' => 'account::invoice.label.name', 'status' => 'account::invoice.label.status', ], 'groups' => [ [ 'icon' => "mdi:account-supervisor-outline", 'name' => "account::invoice.groups.main", 'group' => "main.main", 'title' => "account::invoice.groups.main", ], [ 'icon' => "fe:home", 'name' => "account::invoice.groups.details", 'group' => "main.details", 'title' => "account::invoice.groups.details", ], 'images' => [ 'icon' => "fe:home", 'name' => "account::invoice.groups.images", 'group' => "main.images", 'title' => "account::invoice.groups.images", ], 'settings' => [ 'icon' => "fe:home", 'name' => "account::invoice.groups.settings", 'group' => "main.settings", 'title' => "account::invoice.groups.settings", ] ], 'controller' => [ 'provider' => 'Litecms', 'package' => 'Account', 'module' => 'Invoice', ], 'workflow' => [ 'type' => 'workflow', 'marking_store' => [ 'type' => 'multiple_state', 'arguments' => ['status'], // 'property' => 'status' ], 'supports' => [ \Litecms\Account\Models\Invoice::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' => 'account::invoice.action.copy', 'roles' => [ 'user' => ['superuser', 'admin'], 'team' => ['admin'], 'permission' => ['account.invoice.copy', 'account.invoice.duplicate'], ], 'form' => [ 'count' => [ "element" => 'select', "type" => 'select', "label" => 'account::invoice.label.count', "placeholder" => 'account::invoice.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" => 'account::invoice.label.comment', "placeholder" => 'account::invoice.placeholder.comment', "col" => "12", ], ], ], 'empty' => [ 'type' => ['List', 'Details'], 'label' => 'account::invoice.action.empty', 'roles' => [ 'user' => ['superuser'], ], ], 'section' => [ 'type' => ['Group'], 'api_url' => '', 'action' => 'list', 'label' => 'account::invoice.action.section', 'store' => 'main.units', 'group' => 'main.units' ], ] ];