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' => [ 'brand_id' => [ "type" => 'select', "label" => trans('car::car.label.brand_id'), "placeholder" => trans('car::car.placeholder.brand_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'model_id' => [ "type" => 'select', "label" => trans('car::car.label.model_id'), "placeholder" => trans('car::car.placeholder.model_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'body_type' => [ "type" => 'select', "label" => trans('car::car.label.body_type'), "placeholder" => trans('car::car.placeholder.body_type'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fuel_type' => [ "type" => 'select', "label" => trans('car::car.label.fuel_type'), "placeholder" => trans('car::car.placeholder.fuel_type'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'condition' => [ "type" => 'select', "label" => trans('car::car.label.condition'), "placeholder" => trans('car::car.placeholder.condition'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'release_year' => [ "type" => 'numeric', "label" => trans('car::car.label.release_year'), "placeholder" => trans('car::car.placeholder.release_year'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'speed' => [ "type" => 'text', "label" => trans('car::car.label.speed'), "placeholder" => trans('car::car.placeholder.speed'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'engine' => [ "type" => 'select', "label" => trans('car::car.label.engine'), "placeholder" => trans('car::car.placeholder.engine'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'engine_type' => [ "type" => 'select', "label" => trans('car::car.label.engine_type'), "placeholder" => trans('car::car.placeholder.engine_type'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'horse_power' => [ "type" => 'text', "label" => trans('car::car.label.horse_power'), "placeholder" => trans('car::car.placeholder.horse_power'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'transmission' => [ "type" => 'select', "label" => trans('car::car.label.transmission'), "placeholder" => trans('car::car.placeholder.transmission'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'drive_train' => [ "type" => 'select', "label" => trans('car::car.label.drive_train'), "placeholder" => trans('car::car.placeholder.drive_train'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'torque' => [ "type" => 'text', "label" => trans('car::car.label.torque'), "placeholder" => trans('car::car.placeholder.torque'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'brake' => [ "type" => 'text', "label" => trans('car::car.label.brake'), "placeholder" => trans('car::car.placeholder.brake'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'color' => [ "type" => 'text', "label" => trans('car::car.label.color'), "placeholder" => trans('car::car.placeholder.color'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'gearbox' => [ "type" => 'text', "label" => trans('car::car.label.gearbox'), "placeholder" => trans('car::car.placeholder.gearbox'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fuel_economy' => [ "type" => 'text', "label" => trans('car::car.label.fuel_economy'), "placeholder" => trans('car::car.placeholder.fuel_economy'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'video_link' => [ "type" => 'text', "label" => trans('car::car.label.video_link'), "placeholder" => trans('car::car.placeholder.video_link'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'html_editor', "label" => trans('car::car.label.description'), "placeholder" => trans('car::car.placeholder.description'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'decimal', "label" => trans('car::car.label.price'), "placeholder" => trans('car::car.placeholder.price'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'mileage' => [ "type" => 'decimal', "label" => trans('car::car.label.mileage'), "placeholder" => trans('car::car.placeholder.mileage'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('car::car.label.images'), "placeholder" => trans('car::car.placeholder.images'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'door_count' => [ "type" => 'radios', "label" => trans('car::car.label.door_count'), "placeholder" => trans('car::car.placeholder.door_count'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'exterior_color' => [ "type" => 'radios', "label" => trans('car::car.label.exterior_color'), "placeholder" => trans('car::car.placeholder.exterior_color'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'engine_size' => [ "type" => 'text', "label" => trans('car::car.label.engine_size'), "placeholder" => trans('car::car.placeholder.engine_size'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'drive_type' => [ "type" => 'select', "label" => trans('car::car.label.drive_type'), "placeholder" => trans('car::car.placeholder.drive_type'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address' => [ "type" => 'text', "label" => trans('car::car.label.address'), "placeholder" => trans('car::car.placeholder.address'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'features' => [ "type" => 'html_editor', "label" => trans('car::car.label.features'), "placeholder" => trans('car::car.placeholder.features'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'neighborhood' => [ "type" => 'text', "label" => trans('car::car.label.neighborhood'), "placeholder" => trans('car::car.placeholder.neighborhood'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city' => [ "type" => 'text', "label" => trans('car::car.label.city'), "placeholder" => trans('car::car.placeholder.city'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state' => [ "type" => 'text', "label" => trans('car::car.label.state'), "placeholder" => trans('car::car.placeholder.state'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country' => [ "type" => 'text', "label" => trans('car::car.label.country'), "placeholder" => trans('car::car.placeholder.country'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zip_code' => [ "type" => 'numeric', "label" => trans('car::car.label.zip_code'), "placeholder" => trans('car::car.placeholder.zip_code'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'slider' => [ "type" => 'numeric', "label" => trans('car::car.label.slider'), "placeholder" => trans('car::car.placeholder.slider'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'premium' => [ "type" => 'numeric', "label" => trans('car::car.label.premium'), "placeholder" => trans('car::car.placeholder.premium'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'featured' => [ "type" => 'checkboxes', "label" => trans('car::car.label.featured'), "placeholder" => trans('car::car.placeholder.featured'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }