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' => [ 'id_download' => [ "type" => 'numeric', "label" => trans('file::server.label.id_download'), "placeholder" => trans('file::server.placeholder.id_download'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'judul' => [ "type" => 'text', "label" => trans('file::server.label.judul'), "placeholder" => trans('file::server.placeholder.judul'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'kategori' => [ "type" => 'text', "label" => trans('file::server.label.kategori'), "placeholder" => trans('file::server.placeholder.kategori'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nama_file' => [ "type" => 'text', "label" => trans('file::server.label.nama_file'), "placeholder" => trans('file::server.placeholder.nama_file'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tgl_posting' => [ "type" => 'date_picker', "label" => trans('file::server.label.tgl_posting'), "placeholder" => trans('file::server.placeholder.tgl_posting'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'hits' => [ "type" => 'numeric', "label" => trans('file::server.label.hits'), "placeholder" => trans('file::server.placeholder.hits'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('file::server.label.PRIMARY'), "placeholder" => trans('file::server.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }