'name', 'type' => 'text', 'label' => 'Name' ]); CRUD::addColumn([ 'name' => 'surname', 'type' => 'text', 'label' => 'Surname' ]); CRUD::addColumn([ 'name' => 'patronomic_name', 'type' => 'text', 'label' => 'Patronomic' ]); /** * Columns can be defined using the fluent syntax or array syntax: * - CRUD::column('price')->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(BusinessRequest::class); $this->crud->addFields([ [ 'name' => 'personal', 'label' => 'Personal', 'type' => 'table', 'entity_singular' => 'option', // used on the "Add X" button 'columns' => [ 'name' => 'Name', 'surname' => 'Surname', 'patronomic_name' => 'Patronomic name', 'date_of_birth' => 'Date of birth', 'birth_place' => 'Birth place', 'citizenship_id' => 'Citizenship ID', 'registration_address' => 'Registration address' ], 'max' => 15, 'min' => 0, ], [ 'name' => 'document', 'label' => 'Document', 'type' => 'table', 'entity_singular' => 'option', 'columns' => [ 'doc_name' => 'Doc name', 'doc_series' => 'Doc series', 'doc_number' => 'Doc number', 'doc_date' => 'Doc date', 'doc_given_by' => 'Doc given by' ], 'max' => 15, 'min' => 0, ], [ 'name' => 'job', 'label' => 'Job', 'type' => 'table', 'entity_singular' => 'option', // used on the "Add X" button 'columns' => [ 'work_place' => 'Work place', 'position' => 'Position', 'business_type' => 'Business type', 'licenses' => 'Licenses', ], 'max' => 15, // maximum rows allowed in the table 'min' => 0, // minimum rows allowed in the table ], [ 'label' => "profile", 'type' => 'select', 'name' => 'account.id', // the method that defines the relationship in your Model 'entity' => 'account', // the method that defines the relationship in your Model 'attribute' => 'id', // foreign key attribute that is shown to user 'model' => "App\Models\Account", // foreign key model ] ]); } /** * Define what happens when the Update operation is loaded. * * @see https://backpackforlaravel.com/docs/crud-operation-update * @return void */ protected function setupUpdateOperation() { $this->setupCreateOperation(); } }