crud->setFromDb(); } /** * Define what happens when the Create operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-create * @return void */ protected function setupCreateOperation() { CRUD::setValidation(QuestionRequest::class); CRUD::addFields([ [ 'name' => 'question_text', 'type' => 'textarea', 'label' => 'Question text' ], [ 'name' => 'options', 'type' => 'text', 'label' => 'Options' ] ]); } /** * Define what happens when the Update operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-update * @return void */ protected function setupUpdateOperation() { $this->setupCreateOperation(); } }