laymont / shicontstand
Package for ISO 6346 shipping container codes management
Requires
- php: >=8.3
- illuminate/contracts: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- laravel/framework: ^12.0|^13.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-04-28 16:46:28 UTC
README
Package for ISO 6346 shipping container codes management. This package provides models, controllers, repositories, and resources for managing shipping container codes based on the ISO 6346 standard.
Compatibility
- Laravel: ^12.0 | ^13.0
- PHP: >=8.3
Installation
composer require laymont/shicontstand
Quick Start
- Publish and run migrations:
php artisan vendor:publish --tag="shicontstand-migrations"
php artisan migrate
- Seed data:
php artisan db:seed --class=ShicontstandSeeder
Usage
Models
The package includes 5 models for container codes:
TypeGroup- Container groups (Dry, Refrigerated, Open Top)SizeType- Container sizes (20', 40', 45')LengthCode- Length codes (L, M, E)SizeCode- Size codes (2, G, L)TypeCode- Type codes (G1, R1, etc.)
Repository Pattern
Use the repository for better testability and separation of concerns:
use Laymont\Shicontstand\Repositories\TypeGroupRepository; use Laymont\Shicontstand\Models\TypeGroup; $repository = new TypeGroupRepository(new TypeGroup()); // Get all $groups = $repository->all(); // Get by code $group = $repository->find('22G1'); // Query builder $groups = $repository->query()->where('code', 'like', '2%')->get();
Controllers / API Endpoints
The package automatically registers routes:
GET /scs/type_groups
GET /scs/type_groups/{code}
GET /scs/size_types
GET /scs/size_types/{code}
GET /scs/length_codes
GET /scs/length_codes/{code}
GET /scs/size_codes
GET /scs/size_codes/{code}
GET /scs/type_codes
GET /scs/type_codes/{code}
Facade
use Shicontstand; // Get all type groups Shicontstand::getTypeGroups(); // Get specific type group Shicontstand::getTypeGroup('20GP'); // Get all size types Shicontstand::getSizeTypes(); // Get specific size type Shicontstand::getSizeType('22G1');
In Controller
public function __construct( protected \Laymont\Shicontstand\Shicontstand $shicontstand ) {} public function index() { return $this->shicontstand->getTypeGroups(); }
Configuration
Publish config:
php artisan vendor:publish --tag="shicontstand-config"
Container Model Trait
Use the trait in your container model:
use Laymont\Shicontstand\Http\Concerns\ContainerValidation; class Container extends Model { use ContainerValidation; }
This adds ISO 6346 validation attributes to your model.
Testing
./vendor/bin/pest
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
License
MIT License. See LICENSE.md for more information.
Donaciones
Si encuentras útil este paquete y deseas apoyar su desarrollo y mantenimiento, puedes considerar hacer una donación.
Zinli
- ID de usuario: 3-002-58546608-36
- Recargar: https://recargas.zinli.com/4nVRQUniFdK8DBfPzzfyzR
Visa Prepagada Zinli
- Número: 4850460061276928
Binance Pay
- Binance Pay ID: 206414132
¡Gracias por tu apoyo!