Spaces:
Running
Running
Download app/Http/Middleware/EnsureMaxPlan.php from Ailixir-AI-Team/ailixir-api: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/spaces/Ailixir-AI-Team/ailixir-api/resolve/17620ec48bf4071b3b02de4eac231d791a9eca1c/app/Http/Middleware/EnsureMaxPlan.php
- Command line
-
hf download hf://spaces/Ailixir-AI-Team/ailixir-api@17620ec48bf4071b3b02de4eac231d791a9eca1c/app/Http/Middleware/EnsureMaxPlan.php
-
curl -L -o EnsureMaxPlan.php https://huggingface.co/spaces/Ailixir-AI-Team/ailixir-api/resolve/17620ec48bf4071b3b02de4eac231d791a9eca1c/app/Http/Middleware/EnsureMaxPlan.php
450 Bytes
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Request; | |
| use Symfony\Component\HttpFoundation\Response; | |
| class EnsureMaxPlan | |
| { | |
| public function handle(Request $request, Closure $next): Response | |
| { | |
| $user = $request->user(); | |
| if (!$user->isMax()) { | |
| return response()->json([ | |
| 'message' => 'Max plan required' | |
| ], 403); | |
| } | |
| return $next($request); | |
| } | |
| } | |