revert 17c1c2a521
revert register for sessions. photos with different settings, settings configurable
This commit is contained in:
1 parent
5596437995
commit
858a451396
14 files changed
+71
-515
No files matched your search
@@ -1,31 +0,0 @@
|
||||
<?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('photo_jobs', function (Blueprint $table) {
|
||||
$table->foreignId('photo_session_id')->nullable()->constrained('photo_sessions')->nullOnDelete();
|
||||
$table->foreignId('photo_setting_id')->nullable()->constrained('photo_settings')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('photo_jobs', function (Blueprint $table) {
|
||||
$table->dropForeign(['photo_session_id']);
|
||||
$table->dropForeign(['photo_setting_id']);
|
||||
$table->dropColumn(['photo_session_id', 'photo_setting_id']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
<?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('photo_sessions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('original_image_path');
|
||||
$table->unsignedBigInteger('selected_job_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('photo_sessions');
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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('photo_settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->text('gmic_command');
|
||||
$table->integer('sort_order')->default(0);
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('photo_settings');
|
||||
}
|
||||
};
|
||||
@@ -15,6 +15,11 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$this->call(PhotoSettingSeeder::class);
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\PhotoSetting;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PhotoSettingSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$settings = [
|
||||
[
|
||||
'name' => 'Comic',
|
||||
'gmic_command' => 'cl_comic 4,1,0,0,1,15,15,1,10,20,6,2,0,0,0,0,0,0,50,50',
|
||||
'sort_order' => 1,
|
||||
'is_active' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'Schwarzweiß',
|
||||
'gmic_command' => '-to_gray',
|
||||
'sort_order' => 2,
|
||||
'is_active' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'Weichzeichner',
|
||||
'gmic_command' => '-blur 4 -sharpen 80',
|
||||
'sort_order' => 3,
|
||||
'is_active' => true,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($settings as $setting) {
|
||||
PhotoSetting::firstOrCreate(['name' => $setting['name']], $setting);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user