roundly-consulting/package-toolkit-for-laravel

A native, dependency-free toolkit for building Laravel packages: a fluent package-bootstrap builder, schema key-type macros, and database/config/model helpers.
1,042
Install
composer require roundly-consulting/package-toolkit-for-laravel
Latest Version:1.1.0
PHP:^8.4
License:MIT
Last Updated:Oct 5, 2026
Links: GitHub  ·  Packagist
Maintainer: mihaliak

Package Toolkit for Laravel

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.

Installation

Requires PHP 8.4 and Laravel 12 or 13.

composer require roundly-consulting/package-toolkit-for-laravel

Usage

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

Documentation

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.

Support our work

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.

License

The MIT License (MIT). See LICENSE.md.

Related Packages

nyoncode/laravel-package-toolkit

Tools for easy creating Laravel packages

8,334 0
lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users...

21,372,931 2,345
bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2,756,595 281
jeroennoten/laravel-package-helper

Helpers for Laravel packages

22,903 2
jeroen-g/laravel-packager

A cli tool for creating Laravel packages.

754,092 1,367

Version History

Version Released PHP Laravel License
1.1.0 ^8.4 ^12.0|^13.0 MIT
1.0.0 ^8.4 ^12.0|^13.0 MIT