laravel-admin/site
Laravel package that adds a “site” singleton to the service container for storing app-wide data (supports dot notation). Includes defaults via config, can populate values from a model, and shares the container with all views as $site.
seo.title) mirrors Laravel’s config and env systems, reducing learning curve for developers familiar with Laravel’s ecosystem.$site into views simplifies templating, especially for shared metadata (titles, descriptions, scripts). However, this introduces tight coupling between the container and Blade templates, which may complicate future decoupling efforts (e.g., for API-first projects).app() helper deprecations in favor of app()->make()).@stack directives or new syntax).model() method suggests ORM integration (likely Eloquent), but lacks documentation on handling relationships, caching, or model events. Assumptions:
title, description, etc., attributes by default.Illuminate\Contracts\Container\Container interfaces over concrete App class usage).app() calls with dependency injection where possible.app('site')->get('api_key')).View::share(), config(), or cached repositories)?site.item.added)?Response::json() support).View::share() for lightweight, request-scoped data.Cache::remember()).request()->attributes or custom request objects.SiteUpdated).config(), static classes, session data).View::share() calls with app('site')->set() to test performance and developer ergonomics.// Before
View::share('title', $title);
// After
app('site')->set('title', $title);
config() overrides with container keys (e.g., site.seo.title).$site->get('key').app() calls with app()->make() or dependency injection.@stack or new directives.php artisan vendor:publish --tag="site").SiteServiceProvider in config/app.php.set() calls in AppServiceProvider@boot().app('site')->model($post)).{{ $title }} with {{ $site->get('title') }} in Blade.site.title).CONTAINER.md file.SiteItemUpdated) to log changes.set(), get()) is easy to learn.config).View::share() or config().dd(app('site')->all());
model() calls may hit the DB per request.
Cache::remember('site.container', ...)).How can I help you explore Laravel packages today?