mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
feat: Add functionality to retrieve champion images from the database
- Added a new function `getChampionImage` to fetch champion images based on ID and type. - Created a new model `ChampionImage` to store champion image details in the database. - Implemented seeding of champion images using `ChampionImageSeeder`. - Updated usage of champion images in existing methods.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?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_images', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->text('full_id');
|
||||
$table->integer('champion_id');
|
||||
$table->enum('type', ['splash', 'uncentered_splash', 'loading', 'tile', 'icon', 'ability', 'video']);
|
||||
$table->text('url');
|
||||
$table->foreign('champion_id')->references('champion_id')->on('champions')->onDelete('cascade');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('champion_images');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user