Download the PHP package mimisk/stagebox without Composer
On this page you can find all versions of the php package mimisk/stagebox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mimisk/stagebox
More information about mimisk/stagebox
Files in mimisk/stagebox
Package stagebox
Short Description Laravel package for stagebox management with owner scoping and slug generation.
License MIT
Homepage https://github.com/MimisK13/laravel-stagebox
Informations about the package stagebox
Stagebox
mimisk/stagebox is a Laravel package for managing stagebox records with built-in migrations and automatic slug generation.
Installation
Via Composer
Usage
This package provides:
Mimisk\Stagebox\Models\StageboxEloquent model- internal package migration for the
stageboxestable - owner-scoped stageboxes via polymorphic relation (
stageboxable_type/stageboxable_id)
Run migrations:
Define relation on your owner model:
Create/attach a stagebox through owner relation:
Attach an existing stagebox to owner:
The slug is generated automatically from name when not provided.
Fields:
name(string)slug(unique per owner scope)channels(unsigned tiny integer)returns(unsigned tiny integer, default0)color(string, defaultblack)notes(nullable text)timestamps
Query examples:
Why detach is not supported
stageboxable_type and stageboxable_id are required columns (morphs, non-null), so a stagebox must always belong to an owner.
This means you can re-attach to another owner, but not detach to a null owner.
Prevent orphan stageboxes when owner is deleted
Polymorphic relations do not get database-level cascade delete by default. Delete associated stageboxes before deleting the owner:
Maintenance command
The package includes a maintenance command that deletes orphan stageboxes:
Testing
Credits
License
MIT. Please see the license file for more information.
All versions of stagebox with dependencies
illuminate/support Version ^12.0|^13.0
mimisk/laravel-toolbox Version ^0.0.1