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('account::accounts.label.name'), "placeholder" => trans('account::accounts.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('account::accounts.label.website'), "placeholder" => trans('account::accounts.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('account::accounts.label.email'), "placeholder" => trans('account::accounts.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'numeric', "label" => trans('account::accounts.label.phone'), "placeholder" => trans('account::accounts.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fax' => [ "type" => 'numeric', "label" => trans('account::accounts.label.fax'), "placeholder" => trans('account::accounts.placeholder.fax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_address' => [ "type" => 'text', "label" => trans('account::accounts.label.billing_address'), "placeholder" => trans('account::accounts.placeholder.billing_address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_city' => [ "type" => 'text', "label" => trans('account::accounts.label.billing_city'), "placeholder" => trans('account::accounts.placeholder.billing_city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_state' => [ "type" => 'text', "label" => trans('account::accounts.label.billing_state'), "placeholder" => trans('account::accounts.placeholder.billing_state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_country' => [ "type" => 'text', "label" => trans('account::accounts.label.billing_country'), "placeholder" => trans('account::accounts.placeholder.billing_country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'billing_zipcode' => [ "type" => 'numeric', "label" => trans('account::accounts.label.billing_zipcode'), "placeholder" => trans('account::accounts.placeholder.billing_zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_address' => [ "type" => 'text', "label" => trans('account::accounts.label.shipping_address'), "placeholder" => trans('account::accounts.placeholder.shipping_address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_city' => [ "type" => 'text', "label" => trans('account::accounts.label.shipping_city'), "placeholder" => trans('account::accounts.placeholder.shipping_city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_state' => [ "type" => 'text', "label" => trans('account::accounts.label.shipping_state'), "placeholder" => trans('account::accounts.placeholder.shipping_state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_country' => [ "type" => 'text', "label" => trans('account::accounts.label.shipping_country'), "placeholder" => trans('account::accounts.placeholder.shipping_country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'shipping_zipcode' => [ "type" => 'numeric', "label" => trans('account::accounts.label.shipping_zipcode'), "placeholder" => trans('account::accounts.placeholder.shipping_zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'detail_type' => [ "type" => 'text', "label" => trans('account::accounts.label.detail_type'), "placeholder" => trans('account::accounts.placeholder.detail_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sic_no' => [ "type" => 'text', "label" => trans('account::accounts.label.sic_no'), "placeholder" => trans('account::accounts.placeholder.sic_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'industry' => [ "type" => 'text', "label" => trans('account::accounts.label.industry'), "placeholder" => trans('account::accounts.placeholder.industry'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('account::accounts.label.description'), "placeholder" => trans('account::accounts.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }