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('googleapi::campaign.label.group_id'), "placeholder" => trans('googleapi::campaign.placeholder.group_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'restaurant_id' => [ "type" => 'numeric', "label" => trans('googleapi::campaign.label.restaurant_id'), "placeholder" => trans('googleapi::campaign.placeholder.restaurant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('googleapi::campaign.label.name'), "placeholder" => trans('googleapi::campaign.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subject' => [ "type" => 'text', "label" => trans('googleapi::campaign.label.subject'), "placeholder" => trans('googleapi::campaign.placeholder.subject'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('googleapi::campaign.label.title'), "placeholder" => trans('googleapi::campaign.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'text', "label" => trans('googleapi::campaign.label.content'), "placeholder" => trans('googleapi::campaign.placeholder.content'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'image' => [ "type" => 'text', "label" => trans('googleapi::campaign.label.image'), "placeholder" => trans('googleapi::campaign.placeholder.image'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'schedule_time' => [ "type" => 'date_time_picker', "label" => trans('googleapi::campaign.label.schedule_time'), "placeholder" => trans('googleapi::campaign.placeholder.schedule_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'is_send' => [ "type" => 'numeric', "label" => trans('googleapi::campaign.label.is_send'), "placeholder" => trans('googleapi::campaign.placeholder.is_send'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_at' => [ "type" => 'date_time_picker', "label" => trans('googleapi::campaign.label.created_at'), "placeholder" => trans('googleapi::campaign.placeholder.created_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'deleted_at' => [ "type" => 'date_time_picker', "label" => trans('googleapi::campaign.label.deleted_at'), "placeholder" => trans('googleapi::campaign.placeholder.deleted_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'updated_at' => [ "type" => 'date_time_picker', "label" => trans('googleapi::campaign.label.updated_at'), "placeholder" => trans('googleapi::campaign.placeholder.updated_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }