setForm(); } /** * Return form elements. * * @return array. */ public function form($element = 'fields', $grouped = true) { $item = collect($this->form->get($element)); if ($element == 'fields' && $grouped == true) { return $item->groupBy(['group', 'section']); } return $item; } /** * Sets the form and form elements. * @return null. */ public function setForm() { $this->form = collect([ 'form' => [ 'store' => [], 'update' => [], ], 'groups' => [ 'main' => 'Main', ], 'fields' => [ 'name' => [ "type" => 'text', "label" => trans('accounts::accounts.label.name'), "placeholder" => trans('accounts::accounts.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('accounts::accounts.label.website'), "placeholder" => trans('accounts::accounts.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('accounts::accounts.label.email'), "placeholder" => trans('accounts::accounts.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'numeric', "label" => trans('accounts::accounts.label.phone'), "placeholder" => trans('accounts::accounts.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fax' => [ "type" => 'numeric', "label" => trans('accounts::accounts.label.fax'), "placeholder" => trans('accounts::accounts.placeholder.fax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_address' => [ "type" => 'text', "label" => trans('accounts::accounts.label.billing_address'), "placeholder" => trans('accounts::accounts.placeholder.billing_address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_city' => [ "type" => 'text', "label" => trans('accounts::accounts.label.billing_city'), "placeholder" => trans('accounts::accounts.placeholder.billing_city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_state' => [ "type" => 'text', "label" => trans('accounts::accounts.label.billing_state'), "placeholder" => trans('accounts::accounts.placeholder.billing_state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_country' => [ "type" => 'text', "label" => trans('accounts::accounts.label.billing_country'), "placeholder" => trans('accounts::accounts.placeholder.billing_country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_zipcode' => [ "type" => 'numeric', "label" => trans('accounts::accounts.label.billing_zipcode'), "placeholder" => trans('accounts::accounts.placeholder.billing_zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_address' => [ "type" => 'text', "label" => trans('accounts::accounts.label.shipping_address'), "placeholder" => trans('accounts::accounts.placeholder.shipping_address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_city' => [ "type" => 'text', "label" => trans('accounts::accounts.label.shipping_city'), "placeholder" => trans('accounts::accounts.placeholder.shipping_city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_state' => [ "type" => 'text', "label" => trans('accounts::accounts.label.shipping_state'), "placeholder" => trans('accounts::accounts.placeholder.shipping_state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_country' => [ "type" => 'text', "label" => trans('accounts::accounts.label.shipping_country'), "placeholder" => trans('accounts::accounts.placeholder.shipping_country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_zipcode' => [ "type" => 'numeric', "label" => trans('accounts::accounts.label.shipping_zipcode'), "placeholder" => trans('accounts::accounts.placeholder.shipping_zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'detail_type' => [ "type" => 'text', "label" => trans('accounts::accounts.label.detail_type'), "placeholder" => trans('accounts::accounts.placeholder.detail_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sic_no' => [ "type" => 'text', "label" => trans('accounts::accounts.label.sic_no'), "placeholder" => trans('accounts::accounts.placeholder.sic_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'industry' => [ "type" => 'text', "label" => trans('accounts::accounts.label.industry'), "placeholder" => trans('accounts::accounts.placeholder.industry'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('accounts::accounts.label.description'), "placeholder" => trans('accounts::accounts.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }