business completed

This commit is contained in:
merdan 2022-11-08 14:41:28 +05:00
parent 2824df0ceb
commit 7353a1ccc7
2 changed files with 19 additions and 12 deletions

View File

@ -16,7 +16,7 @@
class BusinessCrudController extends CrudController
{
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation { store as traitStore; }
// use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation { store as traitStore; }
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
@ -30,7 +30,7 @@ public function setup()
{
CRUD::setModel(\App\Models\Business::class);
CRUD::setRoute(config('backpack.base.route_prefix') . '/business');
CRUD::setEntityNameStrings('entrepreneur', 'entrepreneurs');
CRUD::setEntityNameStrings(trans('app.business.title'), trans('app.business.list_title'));
}
/**
@ -44,17 +44,17 @@ protected function setupListOperation()
CRUD::addColumn([
'name' => 'name',
'type' => 'text',
'label' => 'Name'
'label' => trans('app.business.name')
]);
CRUD::addColumn([
'name' => 'surname',
'type' => 'text',
'label' => 'Surname'
'label' => trans('app.business.surname')
]);
CRUD::addColumn([
'name' => 'patronomic_name',
'type' => 'text',
'label' => 'Patronomic'
'label' => trans('app.business.patronomic_name')
]);
@ -78,36 +78,36 @@ protected function setupCreateOperation()
$this->crud->addFields([
[
'name' => 'name',
'label' => 'Name',
'label' => trans('app.business.name'),
'type' => 'text',
],
[
'name' => 'surname',
'label' => 'Surname',
'label' => trans('app.business.surname'),
'type' => 'text',
],
[
'name' => 'patronomic_name',
'label' => 'Patronomic name',
'label' => trans('app.business.patronomic_name'),
'type' => 'text',
],
[
'name' => 'date_of_birth',
'label' => 'Date of birth',
'label' => trans('app.business.date_of_birth'),
'type' => 'date',
],
[
'name' => 'birth_place',
'label' => 'Birth place',
'label' => trans('app.business.birth_place'),
'type' => 'text',
],
[
'name' => 'registration_address',
'label' => 'Registration address',
'label' => trans('app.business.registration_address'),
'type' => 'text',
],
[
'label' => "citizenship_id",
'label' =>trans('app.business.citizenship'),
'type' => 'select',
'name' => 'citizenship', // the method that defines the relationship in your Model
'entity' => 'citizenship', // the method that defines the relationship in your Model

View File

@ -103,6 +103,13 @@
'business' => [
'title' => 'entrepreneur',
'list_title' => 'entrepreneurs',
'name' => 'Name',
'surname' => 'Surname',
'patronomic_name' => 'Patronymic',
'date_of_birth' => 'Date of birth',
'birth_place' => 'Birth place',
'registration_address' => 'Registration address',
'citizenship' => "Citizenship",
],
'contract' => [
'list_title' => 'contracts'