feat: complete user authentication, admin guard, customer account dashboard and branded HTML emails

This commit is contained in:
2026-11-01 13:55:45 +01:00
parent b6ee6938cb
commit ee89da5e61
37 changed files with 1895 additions and 22 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class EnsureUserIsAdmin
{
/**
* Handle an incoming request.
*/
public function handle(Request $request, Closure $next): Response
{
if (! auth()->check()) {
return redirect()->guest(route('login'))
->with('error', 'Log eerst in met je beheerder-account om toegang te krijgen tot het admin gedeelte.');
}
if (! auth()->user()->isAdmin()) {
return redirect()->route('home')
->with('error', 'Je hebt geen beheerderstoegang tot deze pagina.');
}
return $next($request);
}
}