APP als Hybrid Version - Anbindung an API

This commit is contained in:
Kevin Adametz 2026-06-05 09:54:12 +02:00
parent d054732bf5
commit c1514999be
46 changed files with 3418 additions and 196 deletions

View file

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('user_settings', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->unique()->constrained()->cascadeOnDelete();
$table->json('settings');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_settings');
}
};

View file

@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('event_media', function (Blueprint $table) {
$table->id();
$table->uuid('uuid')->unique();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('event_id')->constrained()->cascadeOnDelete();
$table->string('collection')->default('gallery');
$table->string('name');
$table->string('mime_type');
$table->string('disk')->default('local');
$table->string('path');
$table->string('thumbnail_path');
$table->string('preview_path')->nullable();
$table->unsignedBigInteger('size');
$table->unsignedInteger('width')->nullable();
$table->unsignedInteger('height')->nullable();
$table->unsignedInteger('thumbnail_width')->nullable();
$table->unsignedInteger('thumbnail_height')->nullable();
$table->unsignedInteger('preview_width')->nullable();
$table->unsignedInteger('preview_height')->nullable();
$table->timestamps();
$table->index(['user_id', 'event_id']);
$table->index(['event_id', 'collection']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('event_media');
}
};

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('event_media', function (Blueprint $table) {
if (! Schema::hasColumn('event_media', 'preview_path')) {
$table->string('preview_path')->nullable()->after('thumbnail_path');
}
if (! Schema::hasColumn('event_media', 'preview_width')) {
$table->unsignedInteger('preview_width')->nullable()->after('thumbnail_height');
}
if (! Schema::hasColumn('event_media', 'preview_height')) {
$table->unsignedInteger('preview_height')->nullable()->after('preview_width');
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('event_media', function (Blueprint $table) {
$columns = array_filter([
Schema::hasColumn('event_media', 'preview_path') ? 'preview_path' : null,
Schema::hasColumn('event_media', 'preview_width') ? 'preview_width' : null,
Schema::hasColumn('event_media', 'preview_height') ? 'preview_height' : null,
]);
if ($columns !== []) {
$table->dropColumn($columns);
}
});
}
};