Download the PHP package fredlabs/business-units without Composer
On this page you can find all versions of the php package fredlabs/business-units. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fredlabs/business-units
More information about fredlabs/business-units
Files in fredlabs/business-units
Package business-units
Short Description Business units handler for Laravel 10.* and above.
License MIT
Informations about the package business-units
FredLabs Business Units
Handle business unit within your application.
fredlabs/business-units
is a Laravel package for handling business units in your application. It provides a trait and model for managing business units and includes functionality for automatically updating existing tables with a business_unit_id
column.
Requirements
- Laravel 10.x or higher
- PHP 8.2 or higher
- Composer
Installation, and Usage Instructions
To install the package, use Composer:
Publish Vendor Files
After successful installation, publish the package's configuration and migration files by running:
Edit Configuration
The above command will publish customizable configuration files. In the config/business-units.php file, you can add or modify the fillable attributes in the business_units array to specify which fields you want to use for business unit parameters. For example:
Migrate Tables
To apply the changes to your existing tables, including adding the business_unit_id column, run:
Usage
After installation and migration, you can use the HasBusinessUnit trait in your Eloquent models to enable business unit functionality. Here's how to use it in your models:
This trait will allow you to associate business units with your models. Ensure to adjust your models and controllers to handle business unit logic as required.
Authors and Acknowledgments
- FredLabs: Development and maintenance of the package.
- Special thanks to the Laravel community and contributors who provide support and feedback.
License
All versions of business-units with dependencies
illuminate/database Version ^10.0
illuminate/support Version ^10.0
illuminate/auth Version ^8.12|^9.0|^10.0|^11.0