Company management dependency for Laravel Enso.
This package works exclusively within the Enso ecosystem.
The front end assets that utilize this api are present in the ui package.
For live examples and demos, you may visit laravel-enso.com
click on the photo to view a large size screenshot
Comes pre-installed in Enso.
- provides a common functionality for managing companies within the Enso ecosystem
- integrates with the People package so you can associate people to companies
- can be reused and integrated with other modules which might deal with companies (e.g. suppliers ) or even other entities, such as people (e.g. clients)
CompanyFactoryis included by default in the package
- the companies server-side select functionality is also included by default
Under the Hood
- the model comes with a
mandataryrelationship to a person. Of course, the mandatary is optional. You can only set as mandatary one of the people associated to the company.
- once the company has activity in the system (through any other model relationship), it cannot be deleted
- the proper way to delete a company is to first delete any other models it is linked to
- a placeholder types enum in included in the package that is meant to be extended as/if required
Companyattributes are fillable
- note that the
onDeleteDocumentsManager configuration option will affect what happens to the linked documents when you attempt to delete a company.
config/enso/companies.php configuration file, lets you customize the following:
formTemplate- string, is the project relative path to the companies form template, useful for overriding the original
tableTemplate- string, is the project relative path to the companies table template, useful for overriding the original
Extending the companies
In your project you may have the need to alter and or extend the companies structure by changing table columns. To achieve this, you'd need to:
add migration(s) to your local project, making the necessary changes
create a new template for the companies form, and declare it in the config (
create a new template for the companies table, and declare it in the config (
create a new company request validation
bind your local implementation to the package's
ValidateCompanyRequestin your local
$this->app->bind( ValidateCompanyRequest::class, MyValidateCompanyRequest::class );
php artisan vendor:publish --tag=companies-config- configuration file
php artisan vendor:publish --tag=enso-config- a common alias for when wanting to update the configurations, once a newer version is released, usually used with the
php artisan vendor:publish --tag=companies-factory- the factory for the
php artisan vendor:publish --tag=enso-factories- a common alias for when wanting to update the factories, once a newer version is released, usually used with the
are welcome. Pull requests are great, but issues are good too.
This package is released under the MIT license.