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' => [ 'developer_id' => [ "type" => 'numeric', "label" => trans('offplan::project.label.developer_id'), "placeholder" => trans('offplan::project.placeholder.developer_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'project_name' => [ "type" => 'text', "label" => trans('offplan::project.label.project_name'), "placeholder" => trans('offplan::project.placeholder.project_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('offplan::project.label.title'), "placeholder" => trans('offplan::project.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'starting_price' => [ "type" => 'numeric', "label" => trans('offplan::project.label.starting_price'), "placeholder" => trans('offplan::project.placeholder.starting_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'completion' => [ "type" => 'text', "label" => trans('offplan::project.label.completion'), "placeholder" => trans('offplan::project.placeholder.completion'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_plan' => [ "type" => 'text', "label" => trans('offplan::project.label.payment_plan'), "placeholder" => trans('offplan::project.placeholder.payment_plan'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'documents' => [ "type" => 'textarea', "label" => trans('offplan::project.label.documents'), "placeholder" => trans('offplan::project.placeholder.documents'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'features' => [ "type" => 'textarea', "label" => trans('offplan::project.label.features'), "placeholder" => trans('offplan::project.placeholder.features'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'distances' => [ "type" => 'textarea', "label" => trans('offplan::project.label.distances'), "placeholder" => trans('offplan::project.placeholder.distances'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'photos' => [ "type" => 'textarea', "label" => trans('offplan::project.label.photos'), "placeholder" => trans('offplan::project.placeholder.photos'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'floor_plans' => [ "type" => 'textarea', "label" => trans('offplan::project.label.floor_plans'), "placeholder" => trans('offplan::project.placeholder.floor_plans'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }