diff --git a/app/Http/Controllers/ChampionRolesController.php b/app/Http/Controllers/ChampionRolesController.php new file mode 100644 index 0000000..e0ebe65 --- /dev/null +++ b/app/Http/Controllers/ChampionRolesController.php @@ -0,0 +1,66 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/UpdateChampionRolesRequest.php b/app/Http/Requests/UpdateChampionRolesRequest.php new file mode 100644 index 0000000..ac2d603 --- /dev/null +++ b/app/Http/Requests/UpdateChampionRolesRequest.php @@ -0,0 +1,28 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Models/ChampionRoles.php b/app/Models/ChampionRoles.php new file mode 100644 index 0000000..0a84cee --- /dev/null +++ b/app/Models/ChampionRoles.php @@ -0,0 +1,26 @@ + 'array', + ]; + + public function champion() + { + return $this->belongsTo(Champion::class); + } +} diff --git a/app/Policies/ChampionRolesPolicy.php b/app/Policies/ChampionRolesPolicy.php new file mode 100644 index 0000000..e7bc96a --- /dev/null +++ b/app/Policies/ChampionRolesPolicy.php @@ -0,0 +1,66 @@ + + */ +class ChampionRolesFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2023_11_01_134531_create_champion_roles_table.php b/database/migrations/2023_11_01_134531_create_champion_roles_table.php new file mode 100644 index 0000000..9239349 --- /dev/null +++ b/database/migrations/2023_11_01_134531_create_champion_roles_table.php @@ -0,0 +1,32 @@ +id(); + $table->integer('champion_id')->unique(); + $table->string('champion_name'); + $table->json('roles'); + $table->timestamps(); + + $table->foreign('champion_id')->references('champion_id')->on('champions')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('champion_roles'); + } +}; diff --git a/database/seeders/ChampionRolesSeeder.php b/database/seeders/ChampionRolesSeeder.php new file mode 100644 index 0000000..1bea3ad --- /dev/null +++ b/database/seeders/ChampionRolesSeeder.php @@ -0,0 +1,17 @@ +