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('dealer::dealer.label.name'), "placeholder" => trans('dealer::dealer.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dealership_make' => [ "type" => 'numeric', "label" => trans('dealer::dealer.label.dealership_make'), "placeholder" => trans('dealer::dealer.placeholder.dealership_make'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'text', "label" => trans('dealer::dealer.label.phone'), "placeholder" => trans('dealer::dealer.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('dealer::dealer.label.website'), "placeholder" => trans('dealer::dealer.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('dealer::dealer.label.email'), "placeholder" => trans('dealer::dealer.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'opening_from' => [ "type" => 'time_picker', "label" => trans('dealer::dealer.label.opening_from'), "placeholder" => trans('dealer::dealer.placeholder.opening_from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'opening_to' => [ "type" => 'time_picker', "label" => trans('dealer::dealer.label.opening_to'), "placeholder" => trans('dealer::dealer.placeholder.opening_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location' => [ "type" => 'text', "label" => trans('dealer::dealer.label.location'), "placeholder" => trans('dealer::dealer.placeholder.location'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dealer_type' => [ "type" => 'select', "label" => trans('dealer::dealer.label.dealer_type'), "placeholder" => trans('dealer::dealer.placeholder.dealer_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'social_media' => [ "type" => 'text', "label" => trans('dealer::dealer.label.social_media'), "placeholder" => trans('dealer::dealer.placeholder.social_media'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('dealer::dealer.label.description'), "placeholder" => trans('dealer::dealer.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'text', "label" => trans('dealer::dealer.label.images'), "placeholder" => trans('dealer::dealer.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }