crud->setModel('App\Models\Document'); $this->crud->setRoute(config('backpack.base.route_prefix') . '/document'); $this->crud->setEntityNameStrings(trans('backpack::model.document'), trans('backpack::model.documents')); } protected function setupListOperation() { // TODO: remove setFromDb() and manually define Columns, maybe Filters CRUD::column('document_category_id')->type('select')->entity('documentCategory')->model('App\Models\DocumentCategory')->attribute('title'); CRUD::column('title'); CRUD::column('file'); CRUD::column('page'); } protected function setupCreateOperation() { $this->crud->setValidation(DocumentRequest::class); // TODO: remove setFromDb() and manually define Fields CRUD::field('document_category_id')->type('select')->entity('documentCategory')->model('App\Models\DocumentCategory')->attribute('title'); CRUD::field('title'); CRUD::field('file')->type('upload')->upload(true); CRUD::field('page'); } protected function setupUpdateOperation() { $this->setupCreateOperation(); } protected function setupReorderOperation() { // define which model attribute will be shown on draggable elements $this->crud->set('reorder.label', 'title'); // define how deep the admin is allowed to nest the items // for infinite levels, set it to 0 $this->crud->set('reorder.max_level', 1); } }