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('offplan::booking.label.name'), "placeholder" => trans('offplan::booking.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'mobile' => [ "type" => 'text', "label" => trans('offplan::booking.label.mobile'), "placeholder" => trans('offplan::booking.placeholder.mobile'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('offplan::booking.label.email'), "placeholder" => trans('offplan::booking.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'numeric', "label" => trans('offplan::booking.label.price'), "placeholder" => trans('offplan::booking.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_method' => [ "type" => 'text', "label" => trans('offplan::booking.label.payment_method'), "placeholder" => trans('offplan::booking.placeholder.payment_method'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_plan' => [ "type" => 'text', "label" => trans('offplan::booking.label.payment_plan'), "placeholder" => trans('offplan::booking.placeholder.payment_plan'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'agent_id' => [ "type" => 'numeric', "label" => trans('offplan::booking.label.agent_id'), "placeholder" => trans('offplan::booking.placeholder.agent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }