From acb2d64179a425bf8eb5bad0774a5c29e6e17ecf Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 30 May 2024 19:56:30 -0500 Subject: [PATCH] Add files for event and auditions. First draft of migrations --- app/Http/Controllers/AuditionController.php | 10 +++ app/Http/Controllers/EventController.php | 10 +++ app/Models/Audition.php | 11 ++++ app/Models/Event.php | 11 ++++ app/Policies/AuditionPolicy.php | 66 +++++++++++++++++++ app/Policies/EventPolicy.php | 66 +++++++++++++++++++ database/factories/AuditionFactory.php | 23 +++++++ database/factories/EventFactory.php | 23 +++++++ .../2024_05_31_004428_create_events_table.php | 28 ++++++++ ...24_05_31_004546_create_auditions_table.php | 33 ++++++++++ 10 files changed, 281 insertions(+) create mode 100644 app/Http/Controllers/AuditionController.php create mode 100644 app/Http/Controllers/EventController.php create mode 100644 app/Models/Audition.php create mode 100644 app/Models/Event.php create mode 100644 app/Policies/AuditionPolicy.php create mode 100644 app/Policies/EventPolicy.php create mode 100644 database/factories/AuditionFactory.php create mode 100644 database/factories/EventFactory.php create mode 100644 database/migrations/2024_05_31_004428_create_events_table.php create mode 100644 database/migrations/2024_05_31_004546_create_auditions_table.php diff --git a/app/Http/Controllers/AuditionController.php b/app/Http/Controllers/AuditionController.php new file mode 100644 index 0000000..b947da1 --- /dev/null +++ b/app/Http/Controllers/AuditionController.php @@ -0,0 +1,10 @@ + + */ +class AuditionFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/factories/EventFactory.php b/database/factories/EventFactory.php new file mode 100644 index 0000000..41c6c10 --- /dev/null +++ b/database/factories/EventFactory.php @@ -0,0 +1,23 @@ + + */ +class EventFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2024_05_31_004428_create_events_table.php b/database/migrations/2024_05_31_004428_create_events_table.php new file mode 100644 index 0000000..538f11f --- /dev/null +++ b/database/migrations/2024_05_31_004428_create_events_table.php @@ -0,0 +1,28 @@ +id(); + $table->string('name'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('events'); + } +}; diff --git a/database/migrations/2024_05_31_004546_create_auditions_table.php b/database/migrations/2024_05_31_004546_create_auditions_table.php new file mode 100644 index 0000000..0f4181f --- /dev/null +++ b/database/migrations/2024_05_31_004546_create_auditions_table.php @@ -0,0 +1,33 @@ +id(); + $table->foreignIdFor(Event::class)->constrained()->cascadeOnUpdate()->restrictOnDelete(); + $table->string('name'); + $table->integer('order')->nullable()->unique(); + $table->date(('entry_deadline')); + $table->integer('entry_fee'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('auditions'); + } +};