crud->getRequest()->has('order')){ $this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc'); } $this->crud->addColumns([ [ 'name' => 'is_front_show', 'label' => trans('backend.columnName.is_front_show'), 'type' => 'checkbox' ], [ 'name' => 'title', 'label' => trans('backend.columnName.title'), 'type' => 'text' ] ]); } /** * Define what happens when the Create operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-create * @return void */ protected function setupCreateOperation() { CRUD::setValidation(HomeCarouselRequest::class); CRUD::addFields([ [ 'name' => 'is_front_show', 'label' => trans('backend.columnName.is_front_show'), 'type' => 'boolean', 'default' => true, ], [ 'name' => 'title', 'label' => trans('backend.columnName.title'), 'type' => 'text' ], [ 'name' => 'body', 'label' => trans('backend.columnName.body'), 'type' => 'textarea' ], [ 'name' => 'link', 'label' => trans('backend.columnName.link'), 'type' => 'text' ], [ 'name' => 'photos', 'label' => trans('backend.columnName.cover'), 'type' => 'upload_img_multiple', 'upload' => true, 'disk' => 'public', 'hint' => '', 'qty' => 1, // 0=no limit, >0=limit 'showSingleChoise' => '0', // 0=hidden, 1=show(default) 'showComment' => '0', // 0=hidden, 1=show(default) ], ]); } /** * Define what happens when the Update operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-update * @return void */ protected function setupUpdateOperation() { $this->setupCreateOperation(); } }