PHPackages                             roberts/support - 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. roberts/support

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

roberts/support
===============

Common functions used in Laravel packages

v2.0.0(1mo ago)02.1k↑12.5%[1 issues](https://github.com/roberts/support/issues)2MITPHPPHP ^8.5CI passing

Since Oct 17Pushed 1mo agoCompare

[ Source](https://github.com/roberts/support)[ Packagist](https://packagist.org/packages/roberts/support)[ Docs](https://github.com/roberts/support)[ GitHub Sponsors](https://github.com/drewroberts)[ RSS](/packages/roberts-support/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (38)Versions (4)Used By (2)

Common functions used in Laravel packages
=========================================

[](#common-functions-used-in-laravel-packages)

[![Latest Version on Packagist](https://camo.githubusercontent.com/536c408f40fdf5ccbf6f04cfae77153a34a0f22f63941c5ab6be083524a3ea08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f62657274732f737570706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/roberts/support)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e79e48b1047603d82529e469de6bb09fd828f0bd27e61e22726046193379d4f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f62657274732f737570706f72742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/roberts/support/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6f8e52fdfbc46c6889c43870fa7a9725635cc154d12c07769a411222b9b7eeff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f62657274732f737570706f72742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/roberts/support/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d143445d98246dc51a3323e8b6d1c380f3265500ae35df59a6c914a339c311f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f62657274732f737570706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/roberts/support)

Traits, Helper functions, and scaffolding tools for Laravel packages &amp; applications.

🚀 Quick Start: Project Scaffolding
----------------------------------

[](#-quick-start-project-scaffolding)

Quickly set up GitHub Workflow, Actions and Docker:

```
composer require roberts/support
composer support:scaffold
```

This automatically generates:

- ✅ GitHub Actions workflows (tests, PHPStan, linting)
- ✅ Docker configuration for Cloud Run
- ✅ PHPStan configuration
- ✅ VS Code workspace settings

**[Scaffolding Documentation →](SCAFFOLDING.md)**

Features
--------

[](#features)

### Project Scaffolding

[](#project-scaffolding)

- **Auto-detect** project type (Laravel app or package)
- **Smart detection** of features (Flux, Filament, Twitter, Mail)
- **One command** to set up complete CI/CD pipeline
- **Google Cloud Run** deployment ready

### Model Traits

[](#model-traits)

- HasCreator
- HasUpdater

Model Traits for Status

- HasActiveStatus
- HasApplicationStatus
- HasApprovalStatus
- HasModeratorStatus
- HasOrderStatus
- HasProcessingStatus
- HasPublishingStatus
- HasSubscriptionStatus

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

[](#installation)

You can install the package via composer:

```
composer require roberts/support
```

Usage
-----

[](#usage)

On packages or Laravel applications that require this package, you can add the Traits to models like:

```
use HasCreator, HasUpdater, HasPublishingStatus;
```

You may only add 1 of the Status Traits since they all use the same `status` database column. They are not designed to work together but to replace the functionality with the Enum structures.

### Expected Columns

[](#expected-columns)

When using any of the Status Traits on a model, add the following format for the `status` database column on your table:

- `status` (string (25 character max), nullable, index)

**Note:** Status traits automatically set appropriate default values when models are created (e.g., `pending` for moderator status, `active` for active status).

When using the `HasCreator` and/or `HasUpdater` traits on a model, add the following nullable columns to your table:

- `creator_id` (unsignedBigInteger, nullable)
- `updater_id` (unsignedBigInteger, nullable)

Example migration snippet:

```
Schema::table('your_table', function (Blueprint $table) {
	$table->string('status', 25)->nullable()->index();

	$table->foreignId('creator_id')->nullable()->constrained('users');
	$table->foreignId('updater_id')->nullable()->constrained('users');
});
```

The traits automatically:

- Set `creator_id` on model creating (when an authenticated user is present).
- Set `updater_id` on model saving (create and update) when an authenticated user is present.

### Overriding the Auth Provider Model

[](#overriding-the-auth-provider-model)

By default, the creator &amp; updater traits resolve the related user model from `config('auth.providers.users.model')`. If your application uses a different provider or model, ensure the config points to your user class. For example, in `config/auth.php`:

```
'providers' => [
	'users' => [
		'driver' => 'eloquent',
		'model' => App\Models\User::class,
	],
],
```

Or override at runtime (e.g., inside a service provider) if needed:

```
config(['auth.providers.users.model' => App\Domain\Auth\User::class]);
```

Enums
-----

[](#enums)

Status traits use enums with the following values, setting the first one on model creation:

- `HasActiveStatus`: active, inactive
- `HasApplicationStatus`: pending, started, verified, applied, accepted, rejected
- `HasApprovalStatus`: pending, submitted, approved, rejected
- `HasModeratorStatus`: pending, flagged, approved, rejected
- `HasOrderStatus`: cart, pending, checkout, paid, shipped, delivered, canceled
- `HasProcessingStatus`: pending, processing, completed, failed
- `HasPublishingStatus`: draft, scheduled, published, archived
- `HasSubscriptionStatus`: trial, active, canceled, expired

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Drew Roberts](https://github.com/drewroberts)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance89

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.6% 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 ~192 days

Total

2

Last Release

57d ago

Major Versions

v1.0.0 → v2.0.02026-04-27

PHP version history (2 changes)v1.0.0PHP ^8.4

v2.0.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ccc9e3647546c97a5a77b995736302afd85bebdcb43d8fde7d11486579c30c0?d=identicon)[drewroberts](/maintainers/drewroberts)

---

Top Contributors

[![drewroberts](https://avatars.githubusercontent.com/u/24581081?v=4)](https://github.com/drewroberts "drewroberts (50 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravellaravel-packagesupport

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/roberts-support/health.svg)

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

328482.0k25](/packages/codewithdennis-filament-select-tree)[nativephp/desktop

NativePHP for Desktop

38133.6k8](/packages/nativephp-desktop)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124581.3k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

63105.4k2](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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