crud->setModel('App\Models\Category'); $this->crud->setRoute(config('backpack.base.route_prefix') . '/category'); $this->crud->setEntityNameStrings('category', 'categories'); $this->crud->allowAccess('reorder'); $this->crud->enableReorder('name', 3); /* |-------------------------------------------------------------------------- | CrudPanel Configuration |-------------------------------------------------------------------------- */ // TODO: remove setFromDb() and manually define Fields and Columns //$this->crud->setFromDb(); $this->crud->addColumn([ 'name' => 'name', 'type' => 'text', 'label' => trans('admin.name') ]); $this->crud->addField([ 'name' => 'name', 'type' => 'text', 'label' => trans('admin.name') ]); // add asterisk for fields that are required in CategoryRequest $this->crud->setRequiredFields(StoreRequest::class, 'create'); $this->crud->setRequiredFields(UpdateRequest::class, 'edit'); } public function store(StoreRequest $request) { // your additional operations before save here $redirect_location = parent::storeCrud($request); // your additional operations after save here // use $this->data['entry'] or $this->crud->entry return $redirect_location; } public function update(UpdateRequest $request) { // your additional operations before save here $redirect_location = parent::updateCrud($request); // your additional operations after save here // use $this->data['entry'] or $this->crud->entry return $redirect_location; } }