laravel-enso/companies

Company management dependency for Laravel Enso

Maintainers

Package info

github.com/laravel-enso/companies

pkg:composer/laravel-enso/companies

Statistics

Installs: 50 999

Dependents: 8

Suggesters: 0

Stars: 4

Open Issues: 1

4.6.8 2026-04-20 17:08 UTC

README

License Stable Downloads PHP Issues Merge Requests

Description

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.

Installation

Install the package:

composer require laravel-enso/companies

Run the package migrations:

php artisan migrate

Optional publishes:

php artisan vendor:publish --tag=companies-factory
php artisan vendor:publish --tag=companies-seeder

Features

  • 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 Company model.
  • Search provider integration and status enum registration.

Usage

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)

API

HTTP routes

Companies:

  • GET api/administration/companies/create
  • POST api/administration/companies
  • GET api/administration/companies/{company}/edit
  • PATCH api/administration/companies/{company}
  • DELETE api/administration/companies/{company}
  • GET api/administration/companies/initTable
  • GET api/administration/companies/tableData
  • GET api/administration/companies/exportExcel
  • GET api/administration/companies/options

Company people:

  • GET api/administration/companies/people/{company}
  • GET api/administration/companies/people/{company}/create
  • GET api/administration/companies/people/{company}/{person}/edit
  • POST api/administration/companies/people
  • PATCH api/administration/companies/people/{person}
  • DELETE api/administration/companies/people/{company}/{person}

Depends On

Required Enso packages:

Companion frontend package:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!