whilesmart / eloquent-admin
Shared measurements, user directory and automatic email templates for Laravel applications.
Requires
- php: ^8.2
- laravel/framework: ^11.0|^12.0
- whilesmart/eloquent-engagement: ^1.0
- whilesmart/eloquent-owner-access: ^1.0
- whilesmart/laravel-user-authentication: ^1.0
Requires (Dev)
- fakerphp/faker: ^1.24
- laravel/pint: ^1.22
- orchestra/testbench: ^9.0|^10.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-21 10:12:47 UTC
README
Shared administration APIs for Laravel applications. It provides measurements, a user directory, and a registry-backed automatic email template system while leaving authorization, user fields, and product-specific sections to the host.
Host configuration
return [ 'route_prefix' => 'api/v1/admin', 'route_middleware' => ['api', 'auth:sanctum', 'role:admin'], 'user_model' => App\Models\User::class, 'owner' => ['type' => 'platform', 'id' => 0], 'templates' => [ 'welcome' => [ 'name' => 'Welcome email', 'description' => 'Sent after registration.', 'subject' => 'Welcome, {{first_name}}', 'body' => 'Your account is ready.', ], ], ];
The host binds OwnerAuthorizer to protect the configured admin owner. Product-specific user fields belong in a custom API resource or user provider.
Measurements are registered through whilesmart/eloquent-engagement. Every registered metric provider is returned by the admin metrics endpoint and can be rendered by the companion Nuxt layer.
use App\Engagement\OrdersMetricProvider; return [ 'providers' => [ OrdersMetricProvider::class, ], ];
Each provider implements Whilesmart\Engagement\Contracts\MetricProvider and returns count, sum, ratio, series, or ranking metrics. Adding a provider automatically adds its measurements to the shared admin page.