https://github.com/asseco-voice/laravel-containers
Adding container support to Laravel models
https://github.com/asseco-voice/laravel-containers
containers database laravel laravel-8-package laravel-framework laravel-package microservice microservices php
Last synced: about 1 year ago
JSON representation
Adding container support to Laravel models
- Host: GitHub
- URL: https://github.com/asseco-voice/laravel-containers
- Owner: asseco-voice
- License: mit
- Created: 2020-06-04T05:40:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-03T02:51:20.000Z (over 1 year ago)
- Last Synced: 2025-05-26T00:11:38.092Z (about 1 year ago)
- Topics: containers, database, laravel, laravel-8-package, laravel-framework, laravel-package, microservice, microservices, php
- Language: PHP
- Homepage:
- Size: 364 KB
- Stars: 2
- Watchers: 7
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Containers
Purpose of this repository is to provide container support to any Laravel model.
**Container** is an entity for organizing multiple resources under a single logical unit.
## Example
Having a ``contacts`` table:
```
ID First name
1 Foo
2 Bar
3 Baz
4 Boo
5 Far
6 Faz
```
You can logically organize it in 2 containers:
```
ID Name
1 F named
2 B named
```
Resulting in an organized ``contacts`` table
```
ID First name Container ID
1 Foo 1
2 Bar 2
3 Baz 2
4 Boo 2
5 Far 1
6 Faz 1
```
## Installation
Require the package with ``composer require asseco-voice/laravel-containers``.
Service provider for Laravel will be installed automatically.
## Usage
In order to use this repository the following must be done:
1. Run ``php artisan migrate`` to migrate generated migrations
1. Add a ``Containable`` trait to models you wish having containers.
# Extending the package
Publishing the configuration will enable you to change package models as
well as controlling how migrations behave. If extending the model, make sure
you're extending the original model in your implementation.
