add new models and start making DB strucure

This commit is contained in:
2026-09-10 14:08:52 +02:00
parent e300915144
commit 16e22104fb
5 changed files with 116 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Guests extends Model
{
protected $fillable=['access_code', 'email']
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
class Wishes extends Model
{
use HasUuids;
protected $table = 'wishes';
protected $fillable = ['title', 'description', 'reward', 'owner_id', 'status', 'agent_id', 'guest_id'];
public function agent(): BelongsTo
{
return $this->belongsTo(User::class, 'agent_id', 'uuid');
}
public function owner(): BelongsTo
{
return $this->belongsTo(User::class, 'owner_id', 'uuid');
}
public function guest(): BelongsTo
{
return $this->belongsTo(Guest::class, 'guest_id', 'uuid');
}
}
@@ -0,0 +1,34 @@
<?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('wishes', function (Blueprint $table) {
$table->uuid()->primary();
$table->string('title');
$table->text('description');
$table->string('reward')->nullable();
$table->string('agent_id')->nullable();
$table->string('owner_id')->nullable();
$table->foreignUuid('guest_id')->nullable();
$table->enum('status', ['posted', 'taken', 'disabled', 'completed'])->default('posted');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('wishes');
}
};
@@ -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('guests', function (Blueprint $table) {
$table->uuid()->primary();
$table->string('access_code');
$table->string('email');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('guests');
}
};
+14
View File
@@ -11,6 +11,9 @@
:root { :root {
--ui-primary: rgb(255, 0, 0); --ui-primary: rgb(255, 0, 0);
--background-color: rgb(10,10,10); --background-color: rgb(10,10,10);
--color-primary: rgb(250, 250, 250);
--color-a-primary: rgb(142, 234, 252);
--color-a-visited: rgb(252, 142, 250);
} }
@font-face { @font-face {
@@ -47,4 +50,15 @@ footer {
body { body {
background-color: var(--background-color); background-color: var(--background-color);
font-family: Perpetua Regular; font-family: Perpetua Regular;
color: var(--color-primary);
text-align: center;
}
a {
color: var(--color-a-primary);
text-decoration: underline;
}
a:visited {
color: var(--color-a-visited);
} }