forked from magonysandormate/PeePal
Majdnem kész
This commit is contained in:
103
Backend/laravel9/app/Http/Controllers/AuthController.php
Normal file
103
Backend/laravel9/app/Http/Controllers/AuthController.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Tymon\JWTAuth\Facades\JWTAuth;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth:api', ['except' => ['login', 'register']]);
|
||||
}
|
||||
|
||||
public function register(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'nev' => 'required|string',
|
||||
'email' => 'required|email|unique:felhasznalok',
|
||||
'felh_nev' => 'required|string|unique:felhasznalok',
|
||||
'jelszo' => 'required|string|min:6',
|
||||
'jelszo_confirmation' => 'required|same:jelszo',
|
||||
'is_admin' => 'boolean'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json($validator->errors(), 422);
|
||||
}
|
||||
|
||||
$user = User::create([
|
||||
'nev' => $request->nev,
|
||||
'email' => $request->email,
|
||||
'felh_nev' => $request->felh_nev,
|
||||
'jelszo' => $request->jelszo, // This will be hashed via the mutator
|
||||
'is_admin' => $request->is_admin ?? false
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Sikeresen regisztrált felhasználó',
|
||||
'user' => $user
|
||||
], 201);
|
||||
}
|
||||
|
||||
public function login(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'felh_nev' => 'required|string',
|
||||
'jelszo' => 'required|string'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json($validator->errors(), 422);
|
||||
}
|
||||
|
||||
// Since your login fields are custom, you need to specify the fields
|
||||
$credentials = [
|
||||
'felh_nev' => $request->felh_nev,
|
||||
'password' => $request->jelszo // Laravel expects 'password' internally
|
||||
];
|
||||
|
||||
if (!$token = auth('api')->attempt($credentials)) {
|
||||
return response()->json(['error' => 'Helytelen felhasználónév vagy jelszó'], 401);
|
||||
}
|
||||
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
|
||||
public function me()
|
||||
{
|
||||
return response()->json(auth('api')->user());
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
auth('api')->logout();
|
||||
|
||||
return response()->json(['message' => 'Sikeres kijelentkezés']);
|
||||
}
|
||||
|
||||
public function refresh()
|
||||
{
|
||||
try {
|
||||
$token = JWTAuth::parseToken()->refresh();
|
||||
return $this->respondWithToken($token);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['error' => 'Could not refresh token'], 401);
|
||||
}
|
||||
}
|
||||
|
||||
protected function respondWithToken($token)
|
||||
{
|
||||
return response()->json([
|
||||
'access_token' => $token,
|
||||
'token_type' => 'bearer',
|
||||
'expires_in' => config('jwt.ttl') * 60, // Getting TTL from config
|
||||
'user' => auth('api')->user()
|
||||
]);
|
||||
}
|
||||
}
|
||||
13
Backend/laravel9/app/Http/Controllers/Controller.php
Normal file
13
Backend/laravel9/app/Http/Controllers/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
100
Backend/laravel9/app/Http/Controllers/HozzaadasController.php
Normal file
100
Backend/laravel9/app/Http/Controllers/HozzaadasController.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\WcAdatok;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HozzaadasController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validatedData = $request -> validate([
|
||||
'nev' => 'required|string',
|
||||
'kerulet' => 'required|string',
|
||||
'kozeli_megall' => 'required|string',
|
||||
'akadalym' => 'nullable|boolean',
|
||||
'ar' => 'nullable|numeric',
|
||||
'nyitva' => 'nullable|string',
|
||||
'utvonal' => 'required|string',
|
||||
'koordinatak' => 'required|string'
|
||||
]);
|
||||
|
||||
try {
|
||||
$szelesseg = null;
|
||||
$hosszusag = null;
|
||||
|
||||
if (!empty($validatedData['koordinatak'])) {
|
||||
$koordinatak = explode(',', $validatedData['koordinatak']);
|
||||
|
||||
if (count($koordinatak) == 2) {
|
||||
$hosszusag = trim($koordinatak[0]);
|
||||
$szelesseg = trim($koordinatak[1]);
|
||||
|
||||
if (!is_numeric($szelesseg) || !is_numeric($hosszusag)) {
|
||||
return response() -> json([
|
||||
'message' => 'Érvénytelen a koordináták formátuma'
|
||||
], 422);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mosdo = WcAdatok::create([
|
||||
'nev' => $validatedData['nev'],
|
||||
'kerulet' => $validatedData['kerulet'],
|
||||
'kozeli_megall' => $validatedData['kozeli_megall'],
|
||||
'akadalym' => $validatedData['akadalym'],
|
||||
'ar' => $validatedData['ar'],
|
||||
'nyitva' => $validatedData['nyitva'],
|
||||
'utvonal' => $validatedData['utvonal'],
|
||||
'szel_koord' => $szelesseg,
|
||||
'hossz_koord' => $hosszusag
|
||||
]);
|
||||
|
||||
return response() -> json([
|
||||
'message' => 'Sikeres rögzítés',
|
||||
'data' => $mosdo
|
||||
], 201);
|
||||
} catch (\Exception $e) {
|
||||
return response() -> json([
|
||||
'message' => 'Hiba történt a mentés során',
|
||||
'error' => $e -> getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
76
Backend/laravel9/app/Http/Controllers/UserController.php
Normal file
76
Backend/laravel9/app/Http/Controllers/UserController.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validatedData = $request->validate([
|
||||
'nev' => 'required|string',
|
||||
'email' => 'required|email|unique:felhasznalok',
|
||||
'felh_nev' => 'required|string|unique:felhasznalok',
|
||||
'jelszo' => 'required|string|min:6',
|
||||
'is_admin' => 'boolean'
|
||||
]);
|
||||
|
||||
try {
|
||||
$felhasznalo = User::create([
|
||||
'nev' => $validatedData['nev'],
|
||||
'email' => $validatedData['email'],
|
||||
'felh_nev' => $validatedData['felh_nev'],
|
||||
'jelszo' => $validatedData['jelszo'], // Will be hashed by mutator
|
||||
'is_admin' => $validatedData['is_admin'] ?? false
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Sikeres rögzítés',
|
||||
'data' => $felhasznalo
|
||||
], 201);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'message' => 'Hiba történt a mentés során',
|
||||
'error' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
97
Backend/laravel9/app/Http/Controllers/WcController.php
Normal file
97
Backend/laravel9/app/Http/Controllers/WcController.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\WcAdatok;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class WcController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$mosdok = WcAdatok::with('kerulet')->get();
|
||||
return response()->json($mosdok);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validatedData = $request->validate([
|
||||
'nev' => 'required|string',
|
||||
'kerulet_id' => 'required|integer|exists:keruletek,id',
|
||||
'kozeli_megall' => 'required|string',
|
||||
'akadalym' => 'nullable|boolean',
|
||||
'ar' => 'nullable|numeric',
|
||||
'nyitva' => 'nullable|string',
|
||||
'utvonal' => 'required|string',
|
||||
'koordinatak' => 'required|string',
|
||||
'felhasznalo_id' => 'nullable|numeric'
|
||||
]);
|
||||
|
||||
try {
|
||||
$szelesseg = null;
|
||||
$hosszusag = null;
|
||||
|
||||
if (!empty($validatedData['koordinatak'])) {
|
||||
$koordinatak = explode(',', $validatedData['koordinatak']);
|
||||
|
||||
if (count($koordinatak) == 2) {
|
||||
$hosszusag = trim($koordinatak[0]);
|
||||
$szelesseg = trim($koordinatak[1]);
|
||||
|
||||
if (!is_numeric($szelesseg) || !is_numeric($hosszusag)) {
|
||||
return response()->json([
|
||||
'message' => 'Érvénytelen a koordináták formátuma'
|
||||
], 422);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mosdo = WcAdatok::create([
|
||||
'nev' => $validatedData['nev'],
|
||||
'kerulet_id' => $validatedData['kerulet_id'],
|
||||
'kozeli_megall' => $validatedData['kozeli_megall'],
|
||||
'akadalym' => $validatedData['akadalym'],
|
||||
'ar' => $validatedData['ar'],
|
||||
'nyitva' => $validatedData['nyitva'],
|
||||
'utvonal' => $validatedData['utvonal'],
|
||||
'szel_koord' => $szelesseg,
|
||||
'hossz_koord' => $hosszusag,
|
||||
'felhasznalo_id' => $validatedData['felhasznalo_id'] ?? null
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Sikeres rögzítés',
|
||||
'data' => $mosdo
|
||||
], 201);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'message' => 'Hiba történt a mentés során',
|
||||
'error' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$wc = WcAdatok::find($id);
|
||||
|
||||
if (!$wc) {
|
||||
return response()->json(['message' => 'Nem található'], 404);
|
||||
}
|
||||
|
||||
return response()->json($wc);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$mosdo = WcAdatok::find($id);
|
||||
|
||||
if($mosdo){
|
||||
$mosdo -> delete();
|
||||
return response() -> json(['message' => 'Sikeres törlés'], 200);
|
||||
} else {
|
||||
return response() -> json(['message' => 'Nem található'], 404);
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Backend/laravel9/app/Http/Kernel.php
Normal file
67
Backend/laravel9/app/Http/Kernel.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array<int, class-string|string>
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Fruitcake\Cors\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array<string, array<int, class-string|string>>
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array<string, class-string|string>
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
];
|
||||
}
|
||||
21
Backend/laravel9/app/Http/Middleware/Authenticate.php
Normal file
21
Backend/laravel9/app/Http/Middleware/Authenticate.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
return route('login');
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Backend/laravel9/app/Http/Middleware/Cors.php
Normal file
20
Backend/laravel9/app/Http/Middleware/Cors.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Cors
|
||||
{
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
|
||||
$response->headers->set('Access-Control-Allow-Origin', '*');
|
||||
$response->headers->set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
$response->headers->set('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With');
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
17
Backend/laravel9/app/Http/Middleware/EncryptCookies.php
Normal file
17
Backend/laravel9/app/Http/Middleware/EncryptCookies.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||
|
||||
class PreventRequestsDuringMaintenance extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param string|null ...$guards
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ...$guards)
|
||||
{
|
||||
$guards = empty($guards) ? [null] : $guards;
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
19
Backend/laravel9/app/Http/Middleware/TrimStrings.php
Normal file
19
Backend/laravel9/app/Http/Middleware/TrimStrings.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
||||
20
Backend/laravel9/app/Http/Middleware/TrustHosts.php
Normal file
20
Backend/laravel9/app/Http/Middleware/TrustHosts.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array<int, string|null>
|
||||
*/
|
||||
public function hosts()
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
||||
28
Backend/laravel9/app/Http/Middleware/TrustProxies.php
Normal file
28
Backend/laravel9/app/Http/Middleware/TrustProxies.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array<int, string>|string|null
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
17
Backend/laravel9/app/Http/Middleware/VerifyCsrfToken.php
Normal file
17
Backend/laravel9/app/Http/Middleware/VerifyCsrfToken.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user