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' => [ 'media_id' => [ "type" => 'numeric', "label" => trans('media::media_detail.label.media_id'), "placeholder" => trans('media::media_detail.placeholder.media_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category_id' => [ "type" => 'numeric', "label" => trans('media::media_detail.label.category_id'), "placeholder" => trans('media::media_detail.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('media::media_detail.label.title'), "placeholder" => trans('media::media_detail.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('media::media_detail.label.images'), "placeholder" => trans('media::media_detail.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'file' => [ "type" => 'text', "label" => trans('media::media_detail.label.file'), "placeholder" => trans('media::media_detail.placeholder.file'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('media::media_detail.label.description'), "placeholder" => trans('media::media_detail.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'data' => [ "type" => 'text', "label" => trans('media::media_detail.label.data'), "placeholder" => trans('media::media_detail.placeholder.data'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'summary' => [ "type" => 'text', "label" => trans('media::media_detail.label.summary'), "placeholder" => trans('media::media_detail.placeholder.summary'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'text', "label" => trans('media::media_detail.label.price'), "placeholder" => trans('media::media_detail.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }