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' => [ 'category_id' => [ "type" => 'select', "label" => trans('advertisement::advertisement.label.category_id'), "placeholder" => trans('advertisement::advertisement.placeholder.category_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sub_category_id' => [ "type" => 'select', "label" => trans('advertisement::advertisement.label.sub_category_id'), "placeholder" => trans('advertisement::advertisement.placeholder.sub_category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'select', "label" => trans('advertisement::advertisement.label.state_id'), "placeholder" => trans('advertisement::advertisement.placeholder.state_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'select', "label" => trans('advertisement::advertisement.label.city_id'), "placeholder" => trans('advertisement::advertisement.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('advertisement::advertisement.label.name'), "placeholder" => trans('advertisement::advertisement.placeholder.name'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'textarea', "label" => trans('advertisement::advertisement.label.description'), "placeholder" => trans('advertisement::advertisement.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('advertisement::advertisement.label.images'), "placeholder" => trans('advertisement::advertisement.placeholder.images'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'data' => [ "type" => 'text', "label" => trans('advertisement::advertisement.label.data'), "placeholder" => trans('advertisement::advertisement.placeholder.data'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'text', "label" => trans('advertisement::advertisement.label.price'), "placeholder" => trans('advertisement::advertisement.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tags' => [ "type" => 'text', "label" => trans('advertisement::advertisement.label.tags'), "placeholder" => trans('advertisement::advertisement.placeholder.tags'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contact_information' => [ "type" => 'text', "label" => trans('advertisement::advertisement.label.contact_information'), "placeholder" => trans('advertisement::advertisement.placeholder.contact_information'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'cotact_status' => [ "type" => 'text', "label" => trans('advertisement::advertisement.label.cotact_status'), "placeholder" => trans('advertisement::advertisement.placeholder.cotact_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }