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' => [ 'group_id' => [ "type" => 'numeric', "label" => trans('email::emails.label.group_id'), "placeholder" => trans('email::emails.placeholder.group_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'campaign_datetime' => [ "type" => 'date_time_picker', "label" => trans('email::emails.label.campaign_datetime'), "placeholder" => trans('email::emails.placeholder.campaign_datetime'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'html_editor', "label" => trans('email::emails.label.content'), "placeholder" => trans('email::emails.placeholder.content'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_at' => [ "type" => 'date_time_picker', "label" => trans('email::emails.label.created_at'), "placeholder" => trans('email::emails.placeholder.created_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }