effinix/user-permission-bundle
UserInterface with hasPermission() and getPermissions(), which mirrors Laravel’s Authorizable contracts but introduces redundant logic if already using Laravel’s Gate or Policy system.HandlePermissionAttribute).getPermissions(), allowing flexibility to integrate with Laravel’s Eloquent models or cache (e.g., Redis).do_cache: true) aligns with Laravel’s caching mechanisms (e.g., Cache::remember).Attribute, Routing) that may bloat Laravel’s autoloader or conflict with existing Symfony integrations (e.g., API Platform).RequestContext or EventDispatcher, adding friction.do_cache) interact with Laravel’s existing cache drivers (e.g., Redis, database)?UserInterface coexist with Laravel’s Authenticatable or MustVerifyEmail contracts?#[Route]/#[RequirePermission] over Laravel’s Route::get() + middleware, this could be a selling point.RequirePermission attributes into Laravel’s abort_if or Gate::denies.// app/Http/Middleware/CheckPermission.php
public function handle(Request $request, Closure $next, string $permission) {
if (!auth()->user()->hasPermission($permission)) {
abort(403);
}
return $next($request);
}
RequirePermission on controllers/actions and dynamically apply middleware.HandleAttributes trait or a service provider to register routes with permissions.User model to implement Effinix\UserPermissionBundle\DependencyInversion\UserInterface.getPermissions() to query Laravel’s database or cache.symfony/http-foundation and symfony/routing packages (if using attributes).User::with('permissions')->get()).file, redis) can replace Symfony’s cache, but configuration may need adjustments.UserInterface or caching logic requires documentation for future devs.KernelEvents) may introduce unfamiliar debugging steps for Laravel devs.Auth::check()) remain functional during migration.do_cache) should improve scalability for high-traffic permission checks.getPermissions() must scale (e.g., avoid N+1 queries; use Laravel’s with() or load()).do_cache is enabled but invalidation logic fails, users may see outdated access.RequirePermission attributes could crash routes (mitigate with validation).UserInterface or hasPermission() will break all protected routes.EventDispatcher vs. Laravel’s Events service.Route::get().effinix_user_permission.yml) vs. Laravel’s .env.README.md in the app explaining the integration.How can I help you explore Laravel packages today?