bungle/framework
Laravel framework components and utilities for building PHP web applications, providing common helpers and structure for routing, configuration, events, and more as part of the bungle ecosystem.
Installation Add the package via Composer:
composer require bungle-suit/framework
Publish the config file (if available):
php artisan vendor:publish --provider="Bungle\Provider\BungleServiceProvider"
First Use Case
Register the service provider in config/app.php under providers:
Bungle\Provider\BungleServiceProvider::class,
Check the config/bungle.php file for basic configuration (if published).
Basic Usage The package likely provides core utilities (e.g., request handling, middleware, or macros). Start by inspecting:
Bungle facade (if available):
use Bungle\Facades\Bungle;
BungleServiceProvider to see what’s registered (e.g., bindings, aliases, or macros).Request/Response Handling If Bungle includes HTTP utilities, use it for:
use Bungle\Macros\RequestMacros;
RequestMacros::extend('customRule', function ($attribute, $value, $fail) {
// Custom logic
});
return Bungle::response()->json(['data' => $data], 200);
Middleware Integration Attach Bungle middleware to routes or groups:
Route::middleware(['bungle.auth', 'bungle.log'])->group(function () {
// Protected routes
});
Service Binding Bind custom services via the provider:
$this->app->bind('bungle.service', function ($app) {
return new CustomService();
});
Bungle::macro()).Collection, Request).event(new Bungle\Events\CustomEvent($data));
Undocumented Features
src/ directory for undocumented classes/methods.Bungle::macro() exists but isn’t in the docs, verify its usage via:
dd(method_exists(Bungle::class, 'macro'));
Configuration Quirks
$this->app->singleton('bungle.config', function () {
return ['key' => 'default_value'];
});
Middleware Conflicts
app/Http/Kernel.php:
protected $middlewareGroups = [
'web' => [
\Bungle\Http\Middleware\CustomMiddleware::class,
// ...
],
];
RequestMacros::extend('debug', function ($request) {
\Log::debug('Request data:', $request->all());
return $request;
});
php artisan container:dump
HasBungle). Search the codebase for:
grep -r "trait HasBungle" ./vendor/bungle-suit/framework
Str::macro('slugify', function ($string) {
return Str::of($string)->slug('-');
});
EventServiceProvider:
protected $listen = [
\Bungle\Events\CustomEvent::class => [
\App\Listeners\HandleCustomEvent::class,
],
];
php artisan vendor:publish --tag=bungle-views
How can I help you explore Laravel packages today?