Companies adds company management to the Enso administration area.
The package exposes CRUD flows for companies, company-person associations, searchable option lists, and Excel exports. At model level it provides an addressable and notification-aware company model with rememberable lookups, dynamic methods, and helper accessors such as the owner company or the current mandatary.
It is meant for Enso deployments that manage legal entities together with their related people and administrative metadata.
Install the package:
composer require laravel-enso/companiesRun the package migrations:
php artisan migrateOptional publishes:
php artisan vendor:publish --tag=companies-factory
php artisan vendor:publish --tag=companies-seeder- Company CRUD endpoints and table endpoints under
administration.companies. - Company-person association flow with attach, update, and detach operations.
- Option endpoint for company selectors.
- Morph map registration for the
Companymodel. - Search provider integration and status enum registration.
Create and relate companies through the API or directly through the model:
use LaravelEnso\Companies\Models\Company;
$company = Company::create([
'name' => 'Acme SRL',
'fiscal_code' => 'RO12345678',
]);
$company->attachPerson($personId, 'Administrator');
$company->updateMandatary($personId);Useful helpers on the Company model:
owner()mandatary()attachPerson(int $personId, ?string $position = null)updateMandatary(?int $mandataryId)
Companies:
GET api/administration/companies/createPOST api/administration/companiesGET api/administration/companies/{company}/editPATCH api/administration/companies/{company}DELETE api/administration/companies/{company}GET api/administration/companies/initTableGET api/administration/companies/tableDataGET api/administration/companies/exportExcelGET api/administration/companies/options
Company people:
GET api/administration/companies/people/{company}GET api/administration/companies/people/{company}/createGET api/administration/companies/people/{company}/{person}/editPOST api/administration/companies/peoplePATCH api/administration/companies/people/{person}DELETE api/administration/companies/people/{company}/{person}
Required Enso packages:
laravel-enso/addresses↗laravel-enso/core↗laravel-enso/dynamic-methods↗laravel-enso/enums↗laravel-enso/forms↗laravel-enso/helpers↗laravel-enso/migrator↗laravel-enso/people↗laravel-enso/rememberable↗laravel-enso/searchable↗laravel-enso/tables↗laravel-enso/track-who↗
Companion frontend package:
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!