Download the PHP package laragod/toolkit without Composer
On this page you can find all versions of the php package laragod/toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laragod/toolkit
More information about laragod/toolkit
Files in laragod/toolkit
Package toolkit
Short Description Reusable backend toolkit for Laragod portfolio sites
License MIT
Informations about the package toolkit
laragod/toolkit
Reusable backend toolkit for Laragod portfolio sites. Provides shared PHP infrastructure so each client site only needs custom Blade views and per-site config.
What's included
| Component | Description |
|---|---|
ContactNotifier interface |
Core contract for notification channels |
| 5 notifiers | Telegram, Discord, WhatsApp, Email, Storage |
NotificationManager |
Strategy pattern orchestrator |
HealthController |
/ping, /health, /status endpoints |
SitemapController |
Auto-generates sitemap from #[Sitemap] attributes |
SetLocale middleware |
Sets app locale from URL prefix or cookie |
RedirectToLocale middleware |
Redirects / to /{locale} |
ContactFormSubmission |
HTML mailable |
Sitemap attribute |
Marks controller methods for sitemap inclusion |
| Locale helpers | locale_route(), route_with_locale(), available_locales(), current_locale() |
Requirements
- PHP 8.4+
-
Laravel 12.x
Step-by-step setup
1. Install
This publishes three config files into your project:
- config/localization.php
- config/notifications.php
-
config/sitemap.php
- Register SetLocale middleware
In bootstrap/app.php, prepend SetLocale to the web middleware group:
This reads the {locale} route parameter (or falls back to a cookie) and calls app()->setLocale() on every request.
- Configure locales
Edit config/localization.php:
- Set up routes
In routes/web.php:
- Configure notifications
Edit .env:
Available channels: telegram, discord, whatsapp, email, storage
The storage channel writes to a local file and never fails — recommended as a backup alongside any other channel.
- Inject NotificationManager into your contact controller
Returns true if at least one channel succeeds.
- Configure the sitemap
Edit config/sitemap.php:
Set SITEMAP_BASE_URL in .env — keep it separate from APP_URL so tests using APP_URL=http://localhost don't pollute sitemap output.
- Mark controller methods with #[Sitemap]
The SitemapController scans the controllers listed in config/sitemap.php and includes any method decorated with
[Sitemap].
Static pages:
Dynamic pages (slugs):
For routes with a {slug} parameter, provide a static method that returns all slugs:
The sitemap controller calls getProjectSlugs() and generates one URL per slug, per locale, with full hreflang alternates.
[Sitemap] parameters:
┌─────────────┬─────────┬──────────┬──────────────────────────────────────────┐ │ Parameter │ Type │ Default │ Description │ ├─────────────┼─────────┼──────────┼──────────────────────────────────────────┤ │ priority │ float │ 0.5 │ URL priority (0.0–1.0) │ ├─────────────┼─────────┼──────────┼──────────────────────────────────────────┤ │ changefreq │ string │ 'weekly' │ Change frequency hint │ ├─────────────┼─────────┼──────────┼──────────────────────────────────────────┤ │ enabled │ bool │ true │ Set to false to exclude from sitemap │ ├─────────────┼─────────┼──────────┼──────────────────────────────────────────┤ │ slugsMethod │ ?string │ null │ Static method name returning slugs array │ ├─────────────┼─────────┼──────────┼──────────────────────────────────────────┤ │ slugParam │ string │ 'slug' │ Route parameter name for the slug │ └─────────────┴─────────┴──────────┴──────────────────────────────────────────┘
- Locale helpers
Available globally after the package is installed:
- Health endpoints
No setup needed — routes return JSON automatically:
┌─────────────┬────────────────────────┐ │ Route │ Response │ ├─────────────┼────────────────────────┤ │ GET /ping │ {"status":"pong"} │ ├─────────────┼────────────────────────┤ │ GET /health │ {"status":"ok"} │ ├─────────────┼────────────────────────┤ │ GET /status │ {"status":"available"} │ └─────────────┴────────────────────────┘
Updating a client site
composer update laragod/toolkit
No other changes needed as long as you haven't modified the published configs in a breaking way.
Reference implementation
See https://github.com/laragod/laragod for a complete working example of a site built on this toolkit.
All versions of toolkit with dependencies
illuminate/support Version ^12.0
illuminate/http Version ^12.0
illuminate/mail Version ^12.0
illuminate/filesystem Version ^12.0
illuminate/log Version ^12.0
illuminate/routing Version ^12.0