PHPackages                             mimisk/stagebox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mimisk/stagebox

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mimisk/stagebox
===============

Laravel package for stagebox management with owner scoping and slug generation.

v0.1.1(1mo ago)00MITPHPPHP ^8.4CI passing

Since Apr 23Pushed 1mo agoCompare

[ Source](https://github.com/MimisK13/laravel-stagebox)[ Packagist](https://packagist.org/packages/mimisk/stagebox)[ Docs](https://github.com/MimisK13/laravel-stagebox)[ RSS](/packages/mimisk-stagebox/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Stagebox
========

[](#stagebox)

[![Tests](https://github.com/MimisK13/laravel-stagebox/actions/workflows/tests.yml/badge.svg)](https://github.com/MimisK13/laravel-stagebox/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/919a5eba42d04f71a6b5de05ae9153279d3c5d550b334806e671395c07e20aad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696d69736b2f7374616765626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mimisk/stagebox)[![Total Downloads](https://camo.githubusercontent.com/a4302f77e7983323acf3dfaeaa79b9bdcad51d84f660a407df791df4970ffc7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696d69736b2f7374616765626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mimisk/stagebox)

`mimisk/stagebox` is a Laravel package for managing stagebox records with built-in migrations and automatic slug generation.

Installation
------------

[](#installation)

Via Composer

```
composer require mimisk/stagebox
```

Usage
-----

[](#usage)

This package provides:

- `Mimisk\Stagebox\Models\Stagebox` Eloquent model
- internal package migration for the `stageboxes` table
- owner-scoped stageboxes via polymorphic relation (`stageboxable_type` / `stageboxable_id`)

Run migrations:

```
php artisan migrate
```

Define relation on your owner model:

```
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Mimisk\Stagebox\Models\Stagebox;

class Festival extends Model
{
    public function stageboxes(): MorphMany
    {
        return $this->morphMany(Stagebox::class, 'stageboxable');
    }
}
```

Create/attach a stagebox through owner relation:

```
$festival->stageboxes()->create([
    'name' => 'A',
    'channels' => 12,
    'returns' => 4,
    'color' => 'black',
    'notes' => 'Drum Riser',
]);
```

Attach an existing stagebox to owner:

```
$stagebox->stageboxable()->associate($festival);
$stagebox->save();
```

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, default `0`)
- `color` (string, default `black`)
- `notes` (nullable text)
- `timestamps`

Query examples:

```
use Mimisk\Stagebox\Models\Stagebox;

$all = Stagebox::orderBy('name')->get();
$single = Stagebox::query()
    ->where('stageboxable_type', $festival->getMorphClass())
    ->where('stageboxable_id', $festival->getKey())
    ->where('slug', 'a')
    ->first();
```

### Why detach is not supported

[](#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

[](#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:

```
public function destroy(Festival $festival): RedirectResponse
{
    $festival->stageboxes()->delete();
    $festival->delete();

    return redirect()
        ->route('festivals.index')
        ->with('status', 'Festival deleted.');
}
```

### Maintenance command

[](#maintenance-command)

The package includes a maintenance command that deletes orphan stageboxes:

```
php artisan stagebox:clean-orphans
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [MimisK13](https://github.com/MimisK13)
- [All Contributors](https://github.com/MimisK13/laravel-stagebox/contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9fb24d3d1caf4440de446b880db80aaf5eb5b080dff6b6997a8e2783910f1af?d=identicon)[MimisK](/maintainers/MimisK)

---

Top Contributors

[![MimisK13](https://avatars.githubusercontent.com/u/10620005?v=4)](https://github.com/MimisK13 "MimisK13 (3 commits)")

---

Tags

laravelStagebox

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/mimisk-stagebox/health.svg)

```
[![Health](https://phpackages.com/badges/mimisk-stagebox/health.svg)](https://phpackages.com/packages/mimisk-stagebox)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
