Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class CanOnWebGuard
{
public function handle($request, Closure $next, $permission)
{
$user = Auth::guard('web')->user();
// Use can() instead of hasPermissionTo() to work with Gate definitions
// can() is more flexible and works with the multi-guard permission system
if (!$user || !$user->can($permission)) {
abort(403, 'Unauthorized action.');
}
return $next($request);
}
}