kmj/toolkitbundle
KMJ ToolkitBundle is a Laravel/PHP utility package that bundles reusable helpers and toolkit components for common development tasks. It provides convenient building blocks to streamline workflows and help keep application code cleaner and more maintainable.
First, confirm what you actually have. Despite the "Laravel-friendly integration" line in the description, kmj/toolkitbundle is named and structured as a Symfony bundle (Demoboy/ToolkitBundle, *Bundle class convention). With 0 stars, 0 dependents, and a score of 0, treat it as unvetted source until you've read it. Do not add it to composer.json on anything in a request path before you've done a spike.
Minimal steps:
Inspect the metadata before installing.
composer show kmj/toolkitbundle
Look at type (expect symfony-bundle), the PHP and framework constraint ranges, and whether it pulls symfony/framework-bundle or illuminate/*. That single field decides your integration path.
Read these files first, in order:
README.md — install and config instructions (may be absent; if so, that's your answer)composer.json — framework constraints and autoload mapsrc/*Bundle.php — the bundle class and its getContainerExtension()src/DependencyInjection/Configuration.php — the config tree, which is the real public APIsrc/DependencyInjection/*Extension.php — service IDs that get registeredResources/config/services.* — definitions you may need to overridePick your path based on that read.
config/bundles.php, add a config block using the extension alias, then bin/console cache:clear.bundles.php, no compiler pass, no debug:container. Your only realistic options are (a) call the framework-agnostic utility classes directly via Composer autoload, or (b) copy the handful of helpers you want into your own package with a real ServiceProvider. Do not try to register the Symfony bundle class inside Laravel.First use case — the smallest isolated service. Resolve one helper to prove wiring works before adopting anything broader:
bin/console debug:container --show-private | grep -i kmj
Then use it once in a test or a tinker session.
If there is no README and no tagged release, stop and evaluate a fork-and-vendor approach rather than depending on upstream.
Symfony-native usage (the intended path). Register the bundle, then configure through the extension alias instead of touching vendor files:
// config/bundles.php
Kmj\ToolkitBundle\KmjToolkitBundle::class => ['all' => true],
# config/packages/kmj_toolkit.yaml
kmj_toolkit:
# copy the keys straight from DependencyInjection/Configuration.php
Prefer constructor injection by service ID over pulling from the container — that's how you keep the option to swap or remove the package cheap:
final class ReportBuilder
{
public function __construct(private MyFormatter $formatter) {}
}
Laravel-side usage (the realistic path). Since the framework-agnostic core is PSR-friendly, the sane pattern is to depend on the classes directly, not the bundle:
namespace App\Support;
use Kmj\ToolkitBundle\Util\SomeFormatter;
final class FormatterAdapter
{
public function __construct(private SomeFormatter $inner) {}
public function format(array $row): string
{
return $this->inner->format($row);
}
}
Bind it in a service provider and inject FormatterAdapter everywhere. Your application code never mentions the package, so removal is a one-file delete:
// app/Providers/AppServiceProvider.php
$this->app->bind(FormatterAdapter::class, function () {
return new FormatterAdapter(new SomeFormatter(config('toolkit.options', [])));
});
Day-to-day workflow. This is a borrow the ideas package, not a build on package:
Illuminate\Support, Str, Arr, Collection, Http, or Pipeline — which, for a generic "toolkit" of string/array/formatting helpers, is most of it.composer.json require shows symfony/framework-bundle, it is not a Laravel package and won't drop into Laravel's container, config publishing, or facade conventions without an adapter — that's a port, not an install.DependencyInjection/Configuration.php and Extension.php to learn the actual service IDs and config keys. Override services in your app config, never in vendor/.bin/console debug:container --show-private | grep -i kmj and debug:config kmj_toolkit are your fastest checks; a missing service usually means the extension alias or config block is wrong. In Laravel you have neither, which is another reason to go through an adapter.How can I help you explore Laravel packages today?