Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Site Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Centralized Configuration Management: Simplifies global site settings (e.g., SEO metadata, branding, or dynamic content) by consolidating them into a single, accessible container. Reduces scattered config() calls or hardcoded values in views.
  • Dynamic Content Injection: Enables real-time updates to site-wide variables (e.g., A/B testing variants, promotional banners) without redeploying templates. Useful for marketing teams or feature flags.
  • Legacy System Modernization: For older Laravel projects lacking a dedicated CMS or settings manager, this provides a lightweight alternative to building custom solutions.
  • Prototyping/PoC: Quickly scaffold a "site container" for early-stage projects where full-fledged packages (like Spatie’s laravel-settings) are overkill.
  • Build vs. Buy: Justifies avoiding reinventing a simple key-value store for global app state, especially if the team lacks time to build/maintain a custom solution.

When to Consider This Package

  • Avoid if:
    • You need structured validation or database persistence for site settings (this is in-memory only).
    • Your team requires role-based access control or audit logs for configuration changes.
    • You’re using Laravel 8+ and prefer modern alternatives like spatie/laravel-settings or beberlei/attributes for typed configurations.
    • You need caching or environment-specific overrides (this lacks built-in support).
    • The package’s last release (2017) conflicts with your maintenance policies or Laravel version compatibility.
  • Consider if:
    • You’re on Laravel 5.x and need a minimal, dependency-free solution.
    • Your use case is read-heavy (e.g., displaying global variables in views) with no need for complex CRUD.
    • You want to avoid bloating your project with heavier packages for a simple use case.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us centralize all site-wide settings—like titles, SEO tags, or promotional banners—in one place, making updates faster and reducing errors. Think of it like a ‘global variables’ system for our Laravel app. It’s lightweight, avoids custom dev work, and could save us time during launches or marketing campaigns. The trade-off? It’s not as feature-rich as dedicated CMS tools, but it’s a quick win for low-risk changes."

For Engineers:

*"This is a singleton service container for Laravel that exposes global app state to views via $site. Key benefits:

  • No database needed: Uses PHP’s service container (in-memory).
  • Dot notation support: Access nested settings like app('site')->get('seo.title').
  • Model binding: Auto-populate the container from Eloquent models with app('site')->model($post).
  • View integration: Automatically shared as $site in all Blade templates.

Risks:

  • No persistence: Changes reset on server restart (add caching if needed).
  • Legacy code: Last updated for Laravel 5.x; test compatibility.
  • Limited features: No validation, ACLs, or caching built-in.

Use case: Great for prototyping or projects where you need to avoid over-engineering a settings manager. For production, pair with a database-backed solution like Spatie’s package."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
amashukov/lnd-client-php
althinect/enum-permission
andydefer/laravel-actions
aimeos/prisma
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky