forked from magonysandormate/PeePal
Kész mosdó hozzáadás
This commit is contained in:
@@ -24,11 +24,11 @@ class HozzaadasController extends Controller
|
||||
'nev' => 'required|string',
|
||||
'kerulet' => 'required|string',
|
||||
'kozeli_megall' => 'required|string',
|
||||
'akadalym' => 'required|boolean',
|
||||
'ar' => 'required|numeric',
|
||||
'nyitva' => 'required|string',
|
||||
'akadalym' => 'nullable|boolean',
|
||||
'ar' => 'nullable|numeric',
|
||||
'nyitva' => 'nullable|string',
|
||||
'utvonal' => 'required|string',
|
||||
'koordinatak' => 'nullable|string'
|
||||
'koordinatak' => 'required|string'
|
||||
]);
|
||||
|
||||
try {
|
||||
|
||||
20
Backend/peepal_backend/app/Http/Middleware/Cors.php
Normal file
20
Backend/peepal_backend/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;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,15 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
//
|
||||
// Add CORS middleware for API routes
|
||||
$middleware->api([
|
||||
\Illuminate\Http\Middleware\HandleCors::class,
|
||||
]);
|
||||
|
||||
// Or if you want to apply CORS to all routes
|
||||
$middleware->append([
|
||||
\Illuminate\Http\Middleware\HandleCors::class,
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
|
||||
12
Backend/peepal_backend/config/cors.php
Normal file
12
Backend/peepal_backend/config/cors.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'paths' => ['api/*'],
|
||||
'allowed_methods' => ['*'],
|
||||
'allowed_origins' => ['*'], // For development; restrict to your frontend URL in production
|
||||
'allowed_origins_patterns' => [],
|
||||
'allowed_headers' => ['*'],
|
||||
'exposed_headers' => [],
|
||||
'max_age' => 0,
|
||||
'supports_credentials' => false,
|
||||
];
|
||||
@@ -13,11 +13,11 @@ return new class extends Migration
|
||||
$table->string('nev', 250);
|
||||
$table->string('kerulet', 250);
|
||||
$table->string('kozeli_megall', 250);
|
||||
$table->boolean('akadalym');
|
||||
$table->integer('ar');
|
||||
$table->string('nyitva', 250);
|
||||
$table->double('hossz_koord')->nullable();
|
||||
$table->double('szel_koord')->nullable();
|
||||
$table->boolean('akadalym')->nullable();
|
||||
$table->integer('ar')->nullable();
|
||||
$table->string('nyitva', 250)->nullable();
|
||||
$table->double('hossz_koord');
|
||||
$table->double('szel_koord');
|
||||
$table->string('utvonal', 1000);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user