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' => [ 'title' => [ "type" => 'text', "label" => trans('yellowpage::yellowpage.label.title'), "placeholder" => trans('yellowpage::yellowpage.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category_id' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.category_id'), "placeholder" => trans('yellowpage::yellowpage.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subcategory_id' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.subcategory_id'), "placeholder" => trans('yellowpage::yellowpage.placeholder.subcategory_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.phone'), "placeholder" => trans('yellowpage::yellowpage.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'url', "label" => trans('yellowpage::yellowpage.label.website'), "placeholder" => trans('yellowpage::yellowpage.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'email', "label" => trans('yellowpage::yellowpage.label.email'), "placeholder" => trans('yellowpage::yellowpage.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address' => [ "type" => 'textarea', "label" => trans('yellowpage::yellowpage.label.address'), "placeholder" => trans('yellowpage::yellowpage.placeholder.address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.city_id'), "placeholder" => trans('yellowpage::yellowpage.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'district_id' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.district_id'), "placeholder" => trans('yellowpage::yellowpage.placeholder.district_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.state_id'), "placeholder" => trans('yellowpage::yellowpage.placeholder.state_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country_id' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.country_id'), "placeholder" => trans('yellowpage::yellowpage.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zipcode' => [ "type" => 'numeric', "label" => trans('yellowpage::yellowpage.label.zipcode'), "placeholder" => trans('yellowpage::yellowpage.placeholder.zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'lattitude' => [ "type" => 'text', "label" => trans('yellowpage::yellowpage.label.lattitude'), "placeholder" => trans('yellowpage::yellowpage.placeholder.lattitude'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'longitude' => [ "type" => 'text', "label" => trans('yellowpage::yellowpage.label.longitude'), "placeholder" => trans('yellowpage::yellowpage.placeholder.longitude'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'working_hours' => [ "type" => 'text', "label" => trans('yellowpage::yellowpage.label.working_hours'), "placeholder" => trans('yellowpage::yellowpage.placeholder.working_hours'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'html_editor', "label" => trans('yellowpage::yellowpage.label.description'), "placeholder" => trans('yellowpage::yellowpage.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details' => [ "type" => 'html_editor', "label" => trans('yellowpage::yellowpage.label.details'), "placeholder" => trans('yellowpage::yellowpage.placeholder.details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'facilities' => [ "type" => 'checkboxes', "label" => trans('yellowpage::yellowpage.label.facilities'), "placeholder" => trans('yellowpage::yellowpage.placeholder.facilities'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('yellowpage::yellowpage.label.images'), "placeholder" => trans('yellowpage::yellowpage.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_methods' => [ "type" => 'checkboxes', "label" => trans('yellowpage::yellowpage.label.payment_methods'), "placeholder" => trans('yellowpage::yellowpage.placeholder.payment_methods'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'uploaded_folder' => [ "type" => 'text', "label" => trans('yellowpage::yellowpage.label.uploaded_folder'), "placeholder" => trans('yellowpage::yellowpage.placeholder.uploaded_folder'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'published' => [ "type" => 'select', "label" => trans('yellowpage::yellowpage.label.published'), "placeholder" => trans('yellowpage::yellowpage.placeholder.published'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }