Luke Jones

intervle - commit b4600f0

feat: create migrations/model for Eventsb4600f05ac682b396d3eaf327220786bd80222d2LukeJ<luke.jones.2567@gmail.com>2026-03-07T22:04:23Z
diff --git a/app/Models/Event.php b/app/Models/Event.php new file mode 100644 index 0000000..15d0539 --- /dev/null +++ b/app/Models/Event.php @@ -0,0 +1,15 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Model; + +class Event extends Model +{ + protected $fillable = ['date', 'description']; + + protected $casts = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + ]; +} diff --git a/database/migrations/2026_03_07_215945_create_events_table.php b/database/migrations/2026_03_07_215945_create_events_table.php new file mode 100644 index 0000000..1607b46 --- /dev/null +++ b/database/migrations/2026_03_07_215945_create_events_table.php @@ -0,0 +1,23 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +return new class extends Migration +{ + public function up(): void + { + Schema::create('events', function (Blueprint $table) { + $table->id(); + $table->date('date'); + $table->text('description'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('events'); + } +};