A native, dependency-free toolkit for building Laravel packages: a fluent package-bootstrap builder, schema key-type macros, and database/config/model helpers.
roundly-consulting/package-toolkit-for-laravel is a Laravel package for a native, dependency-free toolkit for building laravel packages: a fluent package-bootstrap builder, schema key-type macros, and database/config/model helpers..
It currently has 5 GitHub stars and 3.531 downloads on Packagist (latest version 1.4.0).
Install it with composer require roundly-consulting/package-toolkit-for-laravel.
Discover more Laravel packages by roundly-consulting
or browse all Laravel packages to compare alternatives.
Last updated
A native, dependency-free toolkit for building Laravel packages: a fluent package-bootstrap builder, key-type aware schema macros, strict config readers and small database and model helpers — built only on official Laravel and Symfony APIs.
Requires PHP 8.4 and Laravel 12 or 13.
composer require roundly-consulting/package-toolkit-for-laravel
Describe what your package ships — the base provider wires every console-gated publish, load and command call (migrations are published, never auto-loaded):
use RoundlyConsulting\PackageToolkit\Concerns\RegistersBlueprintMacros;
use RoundlyConsulting\PackageToolkit\Package;
use RoundlyConsulting\PackageToolkit\PackageServiceProvider;
final class CommentsServiceProvider extends PackageServiceProvider
{
use RegistersBlueprintMacros;
public function configurePackage(Package $package): void
{
$package
->name('comments') // tags: comments-config, comments-migrations, …
->hasConfigFile()
->hasMigrations()
->hasTranslations()
->hasCommands([PruneCommentsCommand::class])
->contributesToAbout();
}
public function boot(): void
{
parent::boot();
$this->registerBlueprintMacros(); // morphKey(), ownerKey(), auditable(), …
}
}
Then build key-type aware migrations and read config strictly:
use RoundlyConsulting\PackageToolkit\Enums\KeyType;
use RoundlyConsulting\PackageToolkit\Support\Config;
Schema::create('comments', function (Blueprint $table): void {
$table->id();
$table->morphKey('commentable', KeyType::fromConfig('comments.key_type')); // bigint, uuid or ulid pair
$table->text('body');
$table->auditable(); // timestamps + soft deletes
});
Config::integer('comments.per_page', 20, min: 1, max: 100); // '20' → 20; 'five' throws, never falls back
The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/package-toolkit-for-laravel
Release notes are in CHANGELOG.md. To contribute, see the contributing guide.
This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.
The MIT License (MIT). See LICENSE.md.