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('medium::media.label.name'), "placeholder" => trans('medium::media.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tagline' => [ "type" => 'text', "label" => trans('medium::media.label.tagline'), "placeholder" => trans('medium::media.placeholder.tagline'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_type' => [ "type" => 'text', "label" => trans('medium::media.label.media_type'), "placeholder" => trans('medium::media.placeholder.media_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('medium::media.label.description'), "placeholder" => trans('medium::media.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('medium::media.label.images'), "placeholder" => trans('medium::media.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'upload' => [ "type" => 'images', "label" => trans('medium::media.label.upload'), "placeholder" => trans('medium::media.placeholder.upload'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'format' => [ "type" => 'text', "label" => trans('medium::media.label.format'), "placeholder" => trans('medium::media.placeholder.format'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'targetgroup' => [ "type" => 'text', "label" => trans('medium::media.label.targetgroup'), "placeholder" => trans('medium::media.placeholder.targetgroup'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details' => [ "type" => 'text', "label" => trans('medium::media.label.details'), "placeholder" => trans('medium::media.placeholder.details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'select', "label" => trans('medium::media.label.status'), "placeholder" => trans('medium::media.placeholder.status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }