12345678910111213141516171819202122232425262728 |
- <?php
-
-
- namespace App\Http\Middleware;
-
- use Closure;
- use Illuminate\Http\Request;
-
- class TokenMiddleware
- {
-
-
- public function handle($request, Closure $next)
- {
- if ($request->headers->get("X-Token") != getenv("TOKEN")) {
- abort(401);
- }
- return $next($request);
- }
- }
|