mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
🎨 Champion + Skin databases
This commit is contained in:
23
database/factories/ChampionFactory.php
Normal file
23
database/factories/ChampionFactory.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Champion>
|
||||
*/
|
||||
class ChampionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
23
database/factories/ChampionSkinFactory.php
Normal file
23
database/factories/ChampionSkinFactory.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ChampionSkin>
|
||||
*/
|
||||
class ChampionSkinFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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('champions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->integer('champion_id')->unique();
|
||||
$table->string('key')->unique();
|
||||
$table->string('name');
|
||||
$table->string('title');
|
||||
$table->longText('lore');
|
||||
$table->json('roles');
|
||||
$table->integer('price_be');
|
||||
$table->integer('price_rp');
|
||||
$table->string('resource_type');
|
||||
$table->string('attack_type');
|
||||
$table->string('adaptive_type');
|
||||
$table->string('release_date');
|
||||
$table->string('release_patch');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('champions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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('champion_skins', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->integer('champion_id');
|
||||
$table->integer('full_skin_id');
|
||||
$table->integer('skin_id');
|
||||
$table->string('skin_name');
|
||||
$table->longText('lore');
|
||||
$table->string('availability');
|
||||
$table->boolean('loot_eligible');
|
||||
$table->bigInteger('rp_price');
|
||||
$table->string('raritiy');
|
||||
$table->string('release_date');
|
||||
$table->json('associated_skinline');
|
||||
$table->boolean('new_effects');
|
||||
$table->boolean('new_animations');
|
||||
$table->boolean('new_recall');
|
||||
$table->boolean('new_voice');
|
||||
$table->boolean('new_quotes');
|
||||
$table->json('voice_actor');
|
||||
$table->json('splash_artist');
|
||||
|
||||
$table->foreign('champion_id')->references('champion_id')->on('champions')->onDelete('cascade');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('champion_skins');
|
||||
}
|
||||
};
|
||||
17
database/seeders/ChampionSeeder.php
Normal file
17
database/seeders/ChampionSeeder.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ChampionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
17
database/seeders/ChampionSkinSeeder.php
Normal file
17
database/seeders/ChampionSkinSeeder.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ChampionSkinSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,5 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// \App\Models\User::factory(10)->create();
|
||||
|
||||
// \App\Models\User::factory()->create([
|
||||
// 'name' => 'Test User',
|
||||
// 'email' => 'test@example.com',
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user