type('number'); * - CRUD::addColumn(['name' => 'price', 'type' => 'number']); */ } /** * Define what happens when the Create operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-create * @return void */ protected function setupCreateOperation() { CRUD::setValidation(ContactRequest::class); CRUD::field('name'); CRUD::field('contacts')->type('repeatable')->fields([ [ // Table 'name' => 'contact', 'label' => 'Contact', 'type' => 'table', 'entity_singular' => 'contact', 'columns' => [ 'title' => 'Title', 'phone' => 'Phone', 'mail' => 'Mail', 'fax' => 'Fax' ], 'max' => 2, // maximum rows allowed in the table 'min' => 1, // minimum rows allowed in the table ], ])->new_item_label("Add contact"); /** * Fields can be defined using the fluent syntax or array syntax: * - CRUD::field('price')->type('number'); * - CRUD::addField(['name' => 'price', 'type' => 'number'])); */ } /** * Define what happens when the Update operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-update * @return void */ protected function setupUpdateOperation() { $this->setupCreateOperation(); } }