company completed
This commit is contained in:
parent
06f8f712ff
commit
2824df0ceb
|
|
@ -15,7 +15,7 @@
|
|||
class CompanyCrudController 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;
|
||||
|
|
@ -29,7 +29,7 @@ public function setup()
|
|||
{
|
||||
CRUD::setModel(\App\Models\Company::class);
|
||||
CRUD::setRoute(config('backpack.base.route_prefix') . '/company');
|
||||
CRUD::setEntityNameStrings('company', trans('app.company.list_title'));
|
||||
CRUD::setEntityNameStrings(trans('app.company.title'), trans('app.company.list_title'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -40,34 +40,27 @@ public function setup()
|
|||
*/
|
||||
protected function setupListOperation()
|
||||
{
|
||||
CRUD::column('name');
|
||||
CRUD::column('short_name');
|
||||
CRUD::column('registration_number');
|
||||
CRUD::addColumn([ // Date
|
||||
'name' => 'registration_date',
|
||||
'label' => trans('app.company.registration_date'),
|
||||
'type' => 'date'
|
||||
|
||||
CRUD::addColumns([
|
||||
['name' => 'name', 'type' => 'text', 'label' => trans('app.company.name')],
|
||||
['name' => 'short_name', 'type' => 'text', 'label' => trans('app.company.short_name')],
|
||||
['name' => 'registration_number', 'type' => 'text', 'label' => trans('app.company.registration_number')],
|
||||
['name' => 'state_registration_agency', 'type' => 'text', 'label' => trans('app.company.state_registration_agency')],
|
||||
['name' => 'registration_place', 'type' => 'text', 'label' => trans('app.company.registration_place')],
|
||||
['name' => 'registration_address', 'type' => 'text', 'label' => trans('app.company.registration_address')],
|
||||
[ // Date
|
||||
'name' => 'registration_date',
|
||||
'label' => trans('app.company.registration_date'),
|
||||
'type' => 'date'
|
||||
]
|
||||
]);
|
||||
CRUD::column('state_registration_agency');
|
||||
CRUD::column('registration_place');
|
||||
CRUD::column('registration_address');
|
||||
|
||||
}
|
||||
|
||||
protected function setupShowOperation()
|
||||
{
|
||||
|
||||
CRUD::column('name');
|
||||
CRUD::column('short_name');
|
||||
CRUD::column('registration_number');
|
||||
CRUD::addColumn([
|
||||
'name' => 'registration_date',
|
||||
'label' => trans('app.company.registration_date'),
|
||||
'type' => 'date'
|
||||
]);
|
||||
CRUD::column('state_registration_agency');
|
||||
CRUD::column('registration_place');
|
||||
CRUD::column('registration_address');
|
||||
$this->setupListOperation();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -80,17 +73,20 @@ protected function setupShowOperation()
|
|||
protected function setupCreateOperation()
|
||||
{
|
||||
CRUD::setValidation(CompanyRequest::class);
|
||||
CRUD::field('name');
|
||||
CRUD::field('short_name');
|
||||
CRUD::field('registration_number');
|
||||
CRUD::addFields([
|
||||
['name' => 'name', 'type' => 'text', 'label' => trans('app.company.name')],
|
||||
['name' => 'short_name', 'type' => 'text', 'label' => trans('app.company.short_name')],
|
||||
['name' => 'registration_number', 'type' => 'text', 'label' => trans('app.company.registration_number')],
|
||||
['name' => 'state_registration_agency', 'type' => 'text', 'label' => trans('app.company.state_registration_agency')],
|
||||
['name' => 'registration_place', 'type' => 'text', 'label' => trans('app.company.registration_place')],
|
||||
['name' => 'registration_address', 'type' => 'text', 'label' => trans('app.company.registration_address')],
|
||||
]);
|
||||
|
||||
CRUD::addField([ // Date
|
||||
'name' => 'registration_date',
|
||||
'label' => trans('app.company.registration_date'),
|
||||
'type' => 'date'
|
||||
]);
|
||||
CRUD::field('state_registration_agency');
|
||||
CRUD::field('registration_place');
|
||||
CRUD::field('registration_address');
|
||||
|
||||
/**
|
||||
* Fields can be defined using the fluent syntax or array syntax:
|
||||
|
|
|
|||
|
|
@ -90,11 +90,19 @@
|
|||
|
||||
],
|
||||
'company' => [
|
||||
'title' => 'company',
|
||||
'list_title' => 'companies',
|
||||
'registration_date' => 'Registration date',
|
||||
'name' => 'Name',
|
||||
'short_name' => 'Short name',
|
||||
'registration_number' => 'Registration Number',
|
||||
'state_registration_agency' => 'State registration Agency',
|
||||
'registration_place' => 'Registration Place',
|
||||
'registration_address' => 'Registration Address',
|
||||
],
|
||||
'business' => [
|
||||
'list_title' => 'entrepreneurs'
|
||||
'title' => 'entrepreneur',
|
||||
'list_title' => 'entrepreneurs',
|
||||
],
|
||||
'contract' => [
|
||||
'list_title' => 'contracts'
|
||||
|
|
|
|||
Loading…
Reference in New Issue