mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
Apply fixes from StyleCI
Apply fixes from StyleCI
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Illuminate\Console\Command;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class CloudflarePurgeCommand extends Command
|
||||
@@ -25,10 +25,10 @@ class CloudflarePurgeCommand extends Command
|
||||
|
||||
$response = $client->request(
|
||||
'POST',
|
||||
"https://api.cloudflare.com/client/v4/zones/" . $cf_zone_id . "/purge_cache",
|
||||
'https://api.cloudflare.com/client/v4/zones/'.$cf_zone_id.'/purge_cache',
|
||||
[
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer ' . $cf_auth_bearer,
|
||||
'Authorization' => 'Bearer '.$cf_auth_bearer,
|
||||
'Content-Type' => 'application/json',
|
||||
],
|
||||
'json' => [
|
||||
|
||||
@@ -14,7 +14,7 @@ class UserCreateCommand extends Command
|
||||
public function handle(): void
|
||||
{
|
||||
if (config('app.env') === 'production') {
|
||||
if (!$this->confirm('You are in production mode. Are you sure you want to continue?')) {
|
||||
if (! $this->confirm('You are in production mode. Are you sure you want to continue?')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -27,14 +27,15 @@ class UserCreateCommand extends Command
|
||||
$password_confirmation = $this->secret('Confirm password');
|
||||
$admin = $this->confirm('Is this user an admin?');
|
||||
|
||||
$this->info('Name: ' . $name);
|
||||
$this->info('Email: ' . $email);
|
||||
$this->info('Password: ' . $password);
|
||||
$this->info('Password confirmation: ' . $password_confirmation);
|
||||
$this->info('Admin: ' . $admin);
|
||||
$this->info('Name: '.$name);
|
||||
$this->info('Email: '.$email);
|
||||
$this->info('Password: '.$password);
|
||||
$this->info('Password confirmation: '.$password_confirmation);
|
||||
$this->info('Admin: '.$admin);
|
||||
|
||||
if ($password !== $password_confirmation) {
|
||||
$this->error('Passwords do not match!');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,6 +46,6 @@ class UserCreateCommand extends Command
|
||||
'admin' => $admin,
|
||||
]);
|
||||
|
||||
$this->info('User with name ' . $user->name . 'created successfully.');
|
||||
$this->info('User with name '.$user->name.'created successfully.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Intervention\Image\ImageManager;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\ImageManager;
|
||||
|
||||
function getRoleIcon($roleName): string
|
||||
{
|
||||
@@ -13,7 +13,7 @@ function getRoleIcon($roleName): string
|
||||
'Support' => 'gm-support.png',
|
||||
];
|
||||
|
||||
return asset('img/' . $roleIcons[$roleName]);
|
||||
return asset('img/'.$roleIcons[$roleName]);
|
||||
}
|
||||
|
||||
function getAverageColorFromImageUrl($imageUrl): string
|
||||
@@ -45,7 +45,7 @@ function getAverageColorFromImageUrl($imageUrl): string
|
||||
$avgG = $totalG / $pixelCount;
|
||||
$avgB = $totalB / $pixelCount;
|
||||
|
||||
return sprintf("#%02x%02x%02x", $avgR, $avgG, $avgB);
|
||||
return sprintf('#%02x%02x%02x', $avgR, $avgG, $avgB);
|
||||
}
|
||||
|
||||
function getRoleIconSvg($roleName): string
|
||||
|
||||
@@ -48,10 +48,10 @@ class ChampionController extends Controller
|
||||
$threeDaysInSeconds = 60 * 60 * 24 * 3;
|
||||
$sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6;
|
||||
|
||||
$champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn () => $champion->load('skins', 'lanes'));
|
||||
$champion = Cache::remember('championShowCache'.$champion->slug, $threeDaysInSeconds, static fn () => $champion->load('skins', 'lanes'));
|
||||
|
||||
$splashColor = Cache::remember(
|
||||
'championSplashColorCache' . $champion->slug,
|
||||
'championSplashColorCache'.$champion->slug,
|
||||
$sixMonthsInSeconds,
|
||||
static fn () => getAverageColorFromImageUrl($champion->getChampionImageAttribute())
|
||||
);
|
||||
|
||||
@@ -55,13 +55,13 @@ class ChampionSkinController extends Controller
|
||||
public function show(ChampionSkin $championSkin)
|
||||
{
|
||||
$skin = Cache::remember(
|
||||
'championSkinShowCache' . $championSkin->slug,
|
||||
'championSkinShowCache'.$championSkin->slug,
|
||||
60 * 60 * 48,
|
||||
static fn () => $championSkin->load('champion', 'chromas')
|
||||
);
|
||||
|
||||
$splashColor = Cache::remember(
|
||||
'championSkinSplashColorCache' . $championSkin->slug,
|
||||
'championSkinSplashColorCache'.$championSkin->slug,
|
||||
60 * 60 * 120,
|
||||
static fn () => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute())
|
||||
);
|
||||
|
||||
@@ -28,7 +28,7 @@ class ContactSubmissionController extends Controller
|
||||
'title' => "{$contactSubmission->category->humanReadable()} - {$contactSubmission->subject}",
|
||||
'description' => $descriptionContent,
|
||||
'color' => '#ff8a4c',
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
return redirect()->route('contact.index')->with('success', 'Your message has been sent!');
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Models\Champion;
|
||||
use App\Models\ChampionSkin;
|
||||
use App\Models\SummonerIcon;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
use Spatie\Sheets\Facades\Sheets;
|
||||
|
||||
class HTMLSitemapController extends Controller
|
||||
@@ -20,7 +19,6 @@ class HTMLSitemapController extends Controller
|
||||
$icons = Cache::remember('sitemap_iconsCache', $twentyHoursInSeconds, fn () => SummonerIcon::orderBy('title')->get());
|
||||
$posts = Sheets::all()->sortByDesc('date');
|
||||
|
||||
|
||||
return view('sitemap.index', compact('champions', 'skins', 'icons', 'posts'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use CreativeCrafts\Paginate\Facades\Paginate;
|
||||
use Spatie\Sheets\Facades\Sheets;
|
||||
use Spatie\Sheets\Sheet;
|
||||
use CreativeCrafts\Paginate\Facades\Paginate;
|
||||
|
||||
class PostsController extends Controller
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ class SaleController extends Controller
|
||||
true
|
||||
);
|
||||
$salesData = array_filter($shopData, static fn ($collection) => $collection['path'] === '/event/sales');
|
||||
|
||||
return reset($salesData)['dynamicCollection']['discountedProductsByProductType'] ?? [];
|
||||
});
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ class ContactSubmissionRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'max:254'],
|
||||
'email' => ['required', 'email', 'max:254'],
|
||||
'discord' => ['nullable', 'min:2', 'max:35'],
|
||||
'name' => ['required', 'max:254'],
|
||||
'email' => ['required', 'email', 'max:254'],
|
||||
'discord' => ['nullable', 'min:2', 'max:35'],
|
||||
'category' => ['required', 'in:question,advertising,bug_report,feedback,other'],
|
||||
'subject' => ['required', 'max:254'],
|
||||
'message' => ['required', 'unique:contact_submissions', 'max:3500'],
|
||||
'h-captcha-response' => 'required|HCaptcha'
|
||||
'subject' => ['required', 'max:254'],
|
||||
'message' => ['required', 'unique:contact_submissions', 'max:3500'],
|
||||
'h-captcha-response' => 'required|HCaptcha',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -39,21 +39,21 @@ class Champion extends Model
|
||||
public function getResourceTypeAttribute($value): string
|
||||
{
|
||||
$resourceTypes = [
|
||||
'BLOOD_WELL' => "Blood",
|
||||
"MANA" => "Mana",
|
||||
"ENERGY" => "Energy",
|
||||
"NONE" => "None",
|
||||
"HEALTH" => "Health",
|
||||
"RAGE" => "Rage",
|
||||
"COURAGE" => "Courage",
|
||||
"SHIELD" => "Shield",
|
||||
"FURY" => "Fury",
|
||||
"FEROCITY" => "Ferocity",
|
||||
"HEAT" => "Heat",
|
||||
"GRIT" => "Grit",
|
||||
"BLOODTHIRST" => "Bloodthirst",
|
||||
"FLOW" => "Flow",
|
||||
"SOUL_UNBOUND" => "Soul Unbound",
|
||||
'BLOOD_WELL' => 'Blood',
|
||||
'MANA' => 'Mana',
|
||||
'ENERGY' => 'Energy',
|
||||
'NONE' => 'None',
|
||||
'HEALTH' => 'Health',
|
||||
'RAGE' => 'Rage',
|
||||
'COURAGE' => 'Courage',
|
||||
'SHIELD' => 'Shield',
|
||||
'FURY' => 'Fury',
|
||||
'FEROCITY' => 'Ferocity',
|
||||
'HEAT' => 'Heat',
|
||||
'GRIT' => 'Grit',
|
||||
'BLOODTHIRST' => 'Bloodthirst',
|
||||
'FLOW' => 'Flow',
|
||||
'SOUL_UNBOUND' => 'Soul Unbound',
|
||||
];
|
||||
|
||||
return $resourceTypes[$value];
|
||||
@@ -96,49 +96,48 @@ class Champion extends Model
|
||||
|
||||
public function getChampionImageAttribute($centered = true): string
|
||||
{
|
||||
$url = 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/splash-art';
|
||||
$url = 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/splash-art';
|
||||
|
||||
return $centered ? $url . '/centered' : $url;
|
||||
return $centered ? $url.'/centered' : $url;
|
||||
}
|
||||
|
||||
|
||||
public function getChampionImageLoadingAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/portrait';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/portrait';
|
||||
}
|
||||
|
||||
public function getChampionImageTileAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/tile';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/tile';
|
||||
}
|
||||
|
||||
public function getChampionSquareImageAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/square';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/square';
|
||||
}
|
||||
|
||||
public function getChampionAbilityIconQAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/q';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/q';
|
||||
}
|
||||
|
||||
public function getChampionAbilityIconWAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/w';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/w';
|
||||
}
|
||||
|
||||
public function getChampionAbilityIconEAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/e';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/e';
|
||||
}
|
||||
|
||||
public function getChampionAbilityIconRAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/r';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/r';
|
||||
}
|
||||
|
||||
public function getChampionAbilityIconPAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/p';
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/p';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,16 +74,16 @@ class ChampionSkin extends Model
|
||||
|
||||
public function getSkinImageAttribute(): string
|
||||
{
|
||||
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/' . $this->champion_id . '/' . $this->full_skin_id . '.jpg';
|
||||
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/'.$this->champion_id.'/'.$this->full_skin_id.'.jpg';
|
||||
}
|
||||
|
||||
public function getSkinImageLoadingAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/portrait/skin/' . $this->skin_id;
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/portrait/skin/'.$this->skin_id;
|
||||
}
|
||||
|
||||
public function getSkinImageTileAttribute(): string
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/tile/skin/' . $this->skin_id;
|
||||
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/tile/skin/'.$this->skin_id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Enums\ContactCategory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ContactSubmission extends Model
|
||||
{
|
||||
|
||||
@@ -43,6 +43,6 @@ class SkinChroma extends Model
|
||||
|
||||
public function getChromaImageAttribute()
|
||||
{
|
||||
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-chroma-images/' . $this->skin->champion_id . '/' . $this->chroma_id . '.png';
|
||||
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-chroma-images/'.$this->skin->champion_id.'/'.$this->chroma_id.'.png';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class SummonerIcon extends Model
|
||||
public function getSqidAttribute(): string
|
||||
{
|
||||
$sqids = new Sqids(minLength: 5);
|
||||
|
||||
return $sqids->encode([$this->icon_id]);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::bind('post', function ($path) {
|
||||
return $this->app->make(Sheets::class)
|
||||
->collection('posts')
|
||||
|
||||
@@ -10,6 +10,7 @@ class Current_sales extends Component
|
||||
public function __construct(public array $sales)
|
||||
{
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('components.sales.current_sales');
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace App\View\Components\Skins;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class Paginatedlist extends Component
|
||||
{
|
||||
|
||||
@@ -10,10 +10,10 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
\Scyllaly\HCaptcha\HCaptchaServiceProvider::class,
|
||||
])
|
||||
->withRouting(
|
||||
web: __DIR__ . '/../routes/web.php',
|
||||
api: __DIR__ . '/../routes/api.php',
|
||||
commands: __DIR__ . '/../routes/console.php',
|
||||
channels: __DIR__ . '/../routes/channels.php',
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
api: __DIR__.'/../routes/api.php',
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
channels: __DIR__.'/../routes/channels.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'secret' => env('HCAPTCHA_SECRET'),
|
||||
'sitekey' => env('HCAPTCHA_SITEKEY'),
|
||||
'secret' => env('HCAPTCHA_SECRET'),
|
||||
'sitekey' => env('HCAPTCHA_SITEKEY'),
|
||||
'server-get-config' => false,
|
||||
'options' => [
|
||||
'options' => [
|
||||
'timeout' => 30,
|
||||
],
|
||||
];
|
||||
|
||||
@@ -6,7 +6,6 @@ return [
|
||||
|
||||
'login_route' => env('LOGIN_ROUTE_NAME', 'login'),
|
||||
|
||||
|
||||
'aliases' => Facade::defaultAliases()->merge([
|
||||
'HCaptcha' => Scyllaly\HCaptcha\Facades\HCaptcha::class,
|
||||
// 'Example' => App\Facades\Example::class,
|
||||
|
||||
@@ -19,7 +19,7 @@ return [
|
||||
'posts' => [
|
||||
'driver' => 'local',
|
||||
'root' => base_path('content/posts'),
|
||||
]
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -15,6 +15,6 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'gd'
|
||||
'driver' => 'gd',
|
||||
|
||||
];
|
||||
|
||||
@@ -9,6 +9,6 @@ return [
|
||||
'path_parser' => Spatie\Sheets\PathParsers\SlugParser::class,
|
||||
'content_parser' => Spatie\Sheets\ContentParsers\MarkdownWithFrontMatterParser::class,
|
||||
'extension' => 'md',
|
||||
]
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,13 +4,14 @@ use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Laravel\Pulse\Support\PulseMigration;
|
||||
|
||||
return new class () extends PulseMigration {
|
||||
return new class() extends PulseMigration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->shouldRun()) {
|
||||
if (! $this->shouldRun()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('summoner_icons', function (Blueprint $table) {
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('summoner_emotes', function (Blueprint $table) {
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('contact_submissions', function (Blueprint $table) {
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\ChampionRoles;
|
||||
use App\Models\Champion;
|
||||
use App\Models\ChampionRoles;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -23,8 +23,8 @@ class ChampionRolesSeeder extends Seeder
|
||||
$rolesExists = ChampionRoles::where('champion_id', $championId)->first();
|
||||
$championExists = Champion::where('champion_id', $championId)->first();
|
||||
|
||||
if (!$championExists) {
|
||||
Log::info('Champion with ID ' . $championId . ' does not exist, skipping...');
|
||||
if (! $championExists) {
|
||||
Log::info('Champion with ID '.$championId.' does not exist, skipping...');
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ class ChampionRolesSeeder extends Seeder
|
||||
];
|
||||
|
||||
if ($rolesExists && $this->hasAttributesChanged($rolesExists, $rolesAttributes)) {
|
||||
Log::info('Roles for ' . $championName . ' have changed, updating...');
|
||||
Log::info('Roles for '.$championName.' have changed, updating...');
|
||||
$rolesExists->update($rolesAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$rolesExists) {
|
||||
Log::info('New roles detected for ' . $championName . '! Creating...');
|
||||
} elseif (! $rolesExists) {
|
||||
Log::info('New roles detected for '.$championName.'! Creating...');
|
||||
ChampionRoles::create($rolesAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
|
||||
@@ -41,11 +41,11 @@ class ChampionSeeder extends Seeder
|
||||
// Check if the champion already exists and if any attributes have changed, if so update the champion. If the champion doesn't exist, create it.
|
||||
// This is to prevent the champion data from being updated every time the seeder is run. As I'll probably run this on a cron job.
|
||||
if ($championExists && $this->hasAttributesChanged($championExists, $championAttributes)) {
|
||||
Log::info('Champion ' . $champion['name'] . ' has changed, updating...');
|
||||
Log::info('Champion '.$champion['name'].' has changed, updating...');
|
||||
$championExists->update($championAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$championExists) {
|
||||
Log::info('New champion detected! Creating ' . $champion['name'] . '...');
|
||||
} elseif (! $championExists) {
|
||||
Log::info('New champion detected! Creating '.$champion['name'].'...');
|
||||
Champion::create($championAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class ChampionSkinSeeder extends Seeder
|
||||
'champion_id' => $champion['id'],
|
||||
'full_skin_id' => $skin['id'],
|
||||
'skin_id' => substr($skin['id'], 3),
|
||||
'skin_name' => $skin['name'] . ' ' . $champion['name'],
|
||||
'skin_name' => $skin['name'].' '.$champion['name'],
|
||||
'lore' => $skin['lore'],
|
||||
'availability' => $skin['availability'],
|
||||
'loot_eligible' => $skin['lootEligible'],
|
||||
@@ -65,11 +65,11 @@ class ChampionSkinSeeder extends Seeder
|
||||
// Check if the skin already exists and if any attributes have changed, if so update the skin. If the skin doesn't exist, create it.
|
||||
// This is to prevent the skin data from being updated every time the seeder is run. As I'll probably run this on a cron job.
|
||||
if ($skinExists && $this->hasAttributesChanged($skinExists, $skinAttributes)) {
|
||||
Log::info('Skin ' . $skin['name'] . ' ' . $champion['name'] . ' has changed, updating...');
|
||||
Log::info('Skin '.$skin['name'].' '.$champion['name'].' has changed, updating...');
|
||||
$skinExists->update($skinAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$skinExists) {
|
||||
Log::info('New skin detected! Creating ' . $skin['name'] . ' ' . $champion['name'] . '...');
|
||||
} elseif (! $skinExists) {
|
||||
Log::info('New skin detected! Creating '.$skin['name'].' '.$champion['name'].'...');
|
||||
ChampionSkin::create($skinAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace Database\Seeders;
|
||||
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
@@ -23,6 +23,6 @@ class DatabaseSeeder extends Seeder
|
||||
|
||||
Cache::flush();
|
||||
|
||||
Log::info('Seeding complete at ' . date('Y-m-d H:i:s'));
|
||||
Log::info('Seeding complete at '.date('Y-m-d H:i:s'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class SkinChromaSeeder extends Seeder
|
||||
$chromaAttributes = [
|
||||
'chroma_id' => $chromaId,
|
||||
'full_skin_id' => $skin['id'],
|
||||
'skin_name' => $skin['name'] . ' ' . $champion['name'],
|
||||
'skin_name' => $skin['name'].' '.$champion['name'],
|
||||
'chroma_name' => $chroma['name'],
|
||||
'chroma_colors' => $chroma['colors'],
|
||||
'chroma_image' => $chroma['chromaPath'],
|
||||
@@ -50,11 +50,11 @@ class SkinChromaSeeder extends Seeder
|
||||
}
|
||||
|
||||
if ($chromaExists && $this->hasAttributesChanged($chromaExists, $chromaAttributes)) {
|
||||
Log::info('Updating chroma: ' . $chromaId);
|
||||
Log::info('Updating chroma: '.$chromaId);
|
||||
$chromaExists->update($chromaAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$chromaExists) {
|
||||
Log::info('Creating chroma: ' . $chromaId);
|
||||
} elseif (! $chromaExists) {
|
||||
Log::info('Creating chroma: '.$chromaId);
|
||||
SkinChroma::create($chromaAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ class SummonerEmoteSeeder extends Seeder
|
||||
|
||||
foreach ($emoteData as $emote) {
|
||||
if (str_contains($emote['name'], 'game_summoner_emote_name_')
|
||||
|| $emote['inventoryIcon'] === ""
|
||||
|| $emote['inventoryIcon'] === ''
|
||||
|| empty($emote['inventoryIcon'])
|
||||
|| $emote['inventoryIcon'] === "/lol-game-data/assets/"
|
||||
|| $emote['inventoryIcon'] === '/lol-game-data/assets/'
|
||||
|| $emote['id'] === 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class SummonerEmoteSeeder extends Seeder
|
||||
$emoteId = $emote['id'];
|
||||
$emoteExists = SummonerEmote::where('emote_id', $emoteId)->first();
|
||||
$afterKeyword = str_replace('/lol-game-data/assets/ASSETS/Loadouts/SummonerEmotes', '', $emote['inventoryIcon']);
|
||||
$imageUrl = 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/assets/loadouts/summoneremotes' . strtolower($afterKeyword);
|
||||
$imageUrl = 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/assets/loadouts/summoneremotes'.strtolower($afterKeyword);
|
||||
|
||||
$emoteAttributes = [
|
||||
'emote_id' => $emote['id'],
|
||||
@@ -39,11 +39,11 @@ class SummonerEmoteSeeder extends Seeder
|
||||
];
|
||||
|
||||
if ($emoteExists && $this->hasAttributesChanged($emoteExists, $emoteAttributes)) {
|
||||
Log::info('Emote ' . $emoteId . ' has changed, updating...');
|
||||
Log::info('Emote '.$emoteId.' has changed, updating...');
|
||||
$emoteExists->update($emoteAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$emoteExists) {
|
||||
Log::info('New emote detected! Creating ' . $emoteId . '...');
|
||||
} elseif (! $emoteExists) {
|
||||
Log::info('New emote detected! Creating '.$emoteId.'...');
|
||||
SummonerEmote::create($emoteAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class SummonerIconSeeder extends Seeder
|
||||
'description' => $icon['descriptions'][0]['description'] ?? null,
|
||||
'release_year' => $icon['yearReleased'],
|
||||
'legacy' => $icon['isLegacy'],
|
||||
'image' => 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/' . $icon['id'] . '.jpg',
|
||||
'image' => 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/'.$icon['id'].'.jpg',
|
||||
'esports_team' => $icon['esportsTeam'] ?? null,
|
||||
'esports_region' => $icon['esportsRegion'] ?? null,
|
||||
'esports_event' => $icon['esportsEvent'] ?? null,
|
||||
@@ -41,11 +41,11 @@ class SummonerIconSeeder extends Seeder
|
||||
// Check if the champion already exists and if any attributes have changed, if so update the champion. If the champion doesn't exist, create it.
|
||||
// This is to prevent the champion data from being updated every time the seeder is run. As I'll probably run this on a cron job.
|
||||
if ($iconExists && $this->hasAttributesChanged($iconExists, $iconAttributes)) {
|
||||
Log::info('Icon ' . $iconId . ' has changed, updating...');
|
||||
Log::info('Icon '.$iconId.' has changed, updating...');
|
||||
$iconExists->update($iconAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$iconExists) {
|
||||
Log::info('New icon detected! Creating ' . $iconId . '...');
|
||||
} elseif (! $iconExists) {
|
||||
Log::info('New icon detected! Creating '.$iconId.'...');
|
||||
SummonerIcon::create($iconAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ use Illuminate\Http\Request;
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
// Determine if the application is in maintenance mode...
|
||||
if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) {
|
||||
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||
require $maintenance;
|
||||
}
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the request...
|
||||
(require_once __DIR__ . '/../bootstrap/app.php')
|
||||
(require_once __DIR__.'/../bootstrap/app.php')
|
||||
->handleRequest(Request::capture());
|
||||
|
||||
@@ -17,6 +17,6 @@ return static function (RectorConfig $rectorConfig): void {
|
||||
SetList::DEAD_CODE,
|
||||
SetList::EARLY_RETURN,
|
||||
SetList::STRICT_BOOLEANS,
|
||||
LevelSetList::UP_TO_PHP_82
|
||||
LevelSetList::UP_TO_PHP_82,
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|
||||
@@ -13,7 +13,6 @@ use Illuminate\Support\Facades\Schedule;
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
Schedule::command('db:seed --force')->twiceDaily(1, 13)->timezone('Europe/Amsterdam');
|
||||
|
||||
Schedule::command('sitemap:generate')->weekly();
|
||||
|
||||
@@ -16,8 +16,8 @@ use App\Http\Requests\ContactSubmissionRequest;
|
||||
use App\Models\Champion;
|
||||
use App\Models\SummonerIcon;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Spatie\Sheets\Sheet;
|
||||
use Spatie\Honeypot\ProtectAgainstSpam;
|
||||
use Spatie\Sheets\Sheet;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user