Installation:
composer require carloschininin/app-bundle
Publish the bundle’s assets and configuration (if applicable):
php artisan vendor:publish --provider="CarlosChininin\AppBundle\AppBundleServiceProvider"
First Use Case:
config/app-bundle.php for core settings (e.g., default routes, middleware, or service bindings).config/app.php under providers:
CarlosChininin\AppBundle\AppBundleServiceProvider::class,
php artisan migrate
Where to Look First:
vendor/carloschininin/app-bundle/src/AppBundleServiceProvider.php (entry point for bindings, routes, and events).config/app-bundle.php (customize defaults like route prefixes, middleware stacks).routes/app-bundle.php file (if provided) or look for route registrations in the service provider.README.md for setup instructions, features, and examples.Service Binding:
use CarlosChininin\AppBundle\Services\ExampleService;
class MyController extends Controller {
public function __construct(private ExampleService $exampleService) {}
}
Middleware Integration:
// app/Http/Kernel.php
protected $middleware = [
// ...
\CarlosChininin\AppBundle\Http\Middleware\ExampleMiddleware::class,
];
Route Grouping:
Route::prefix(config('app-bundle.route_prefix'))->group(function () {
Route::get('/example', [ExampleController::class, 'index']);
});
Events and Listeners:
ExampleEvent) in your EventServiceProvider:
protected $listen = [
\CarlosChininin\AppBundle\Events\ExampleEvent::class => [
\App\Listeners\HandleExampleEvent::class,
],
];
Blade Directives/Tags:
@exampleDirective('argument')
Extending Functionality:
php artisan vendor:publish --tag="app-bundle-config"
Testing:
$this->app->instance(ExampleService::class, MockExampleService::class);
tests/TestCase.php.Deployment:
npm run dev # or prod
php artisan app-bundle:assets # if CLI commands exist
webpack.mix.js.database/migrations/ and run them post-install.namespace App\Http\Resources extends \CarlosChininin\AppBundle\Http\Resources;
Namespace Collisions:
CarlosChininin\AppBundle. Avoid naming conflicts in your app (e.g., AppBundle class names).Missing Configuration:
config/app-bundle.php for required keys (e.g., enabled: true).Undocumented Dependencies:
Route Conflicts:
routes/web.php or via the service provider, ensure they don’t clash with your existing routes.Service Provider Loading Order:
config/app.php.Log Output:
APP_DEBUG=true) and check Laravel logs (storage/logs/laravel.log) for bundle-related errors.Service Binding Issues:
php artisan container:dump to inspect bindings and resolve missing service errors.Route Debugging:
php artisan route:list
Configuration Overrides:
config('app-bundle.key') to check runtime values.Customization:
App\Services\CustomExampleService extends \CarlosChininin\AppBundle\Services\ExampleService).CLI Commands:
app-bundle:generate), list them with:
php artisan list
Testing:
--env=testing flag to test bundle features in isolation:
php artisan test --env=testing
Performance:
Community:
How can I help you explore Laravel packages today?