grixu / socius-models
Models for Socius API and all apps using Socius which need to keep local copy of data.
Installs: 1 466
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 6
Requires
- php: ^8.0
- grixu/data-factories: ^2.0
- grixu/socius-dto: ^2.0
- illuminate/database: ^9.0
- illuminate/support: ^9.0
- spatie/data-transfer-object: ^3.8
- spatie/laravel-enum: ^3.0
Requires (Dev)
- brainmaestro/composer-git-hooks: ^v3.0.0-alpha.1
- doctrine/dbal: ^3.1
- friendsofphp/php-cs-fixer: ^3.0
- nunomaduro/larastan: ^1.0.0
- nunomaduro/phpinsights: ^2.0
- orchestra/testbench: ^7.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.13
- spatie/x-ray: ^1.1
- dev-main
- v4.0.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.0
- v2.4.4
- v2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dependabot/github_actions/shivammathur/setup-php-2.23.0
- dev-dependabot/github_actions/8398a7/action-slack-3.15.0
- dev-dependabot/github_actions/dependabot/fetch-metadata-1.3.5
- dev-dependabot/github_actions/actions/cache-3.0.11
- dev-dependabot/github_actions/actions/checkout-3.1.0
- dev-dependabot/composer/nunomaduro/larastan-tw-1.0.0or-tw-2.0.0
This package is auto-updated.
Last update: 2023-01-26 01:18:38 UTC
README
This package contains models for Socius API and all apps using Socius and need to keep local data copy.
Installation
You can install the package via composer:
composer require grixu/socius-models
Usage
Models are divided into 5 modules:
- product
- customer
- operator
- warehouse
- description
Of course, some models have cross-module relationships. Some of them are very natural like: descriptions have foreign key to products (it's obvious). We created migrations, models and factories to be much flexible as possible. So we only assume that tables in each module exists - models just checking table exists on cross-module relationships.
Publishing migrations
By default, package do not loading migrations to your application. You must do it manually - it gives you
power to control table structure - in case if you want to add some custom fields. If you do so,
please remember about extending Model and overwrite default $fillable
.
To publish migrations:
# php artisan vendor:publish --tag=socius-migrations-model-name # Eg: php artisan vendor:publish --tag=socius-migrations-branch # Or all at once: php artisan vendor:publish --tag=socius-migrations
Generating models & factories
You can also create local, customizable version both models & their factories. To do that just type:
# php artisan socius:model-name ModelNameInLocalApp # Eg: php artisan socius:product MyProduct
You also could generate them with custom namespace for model & factory:
php artisan socius:product MyProduct Custom\\Namespace\\Models Custom\\Namespace\\Factories
Same way with factories:
# php artisan socius:model-name-factory ModelNameInLocalApp # Eg: php artisan socius:product-factory MyFactory # With custom namespace: php artisan socius:product-factory MyFactory Custom\\Namespace\\Factories Custom\\Namespace\\Models
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mateusz.gostanski@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.