forge/app/View/Components/ModList.php

40 lines
811 B
PHP
Raw Normal View History

2024-05-17 23:54:03 -04:00
<?php
namespace App\View\Components;
2024-09-11 23:08:58 -04:00
use App\Models\Mod;
2024-05-17 23:54:03 -04:00
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Collection;
2024-05-17 23:54:03 -04:00
use Illuminate\View\Component;
class ModList extends Component
{
2024-09-11 23:08:58 -04:00
/**
* The mods to display.
*
* @var Collection<int, Mod>
*/
public Collection $mods;
2024-05-22 01:00:37 -04:00
2024-05-17 23:54:03 -04:00
public string $versionScope;
2024-09-11 23:08:58 -04:00
/**
* Create a new component instance.
*
* @param Collection<int, Mod> $mods
*/
public function __construct(Collection $mods, string $versionScope)
2024-05-17 23:54:03 -04:00
{
$this->mods = $mods;
$this->versionScope = $versionScope;
}
public function render(): View
{
return view('components.mod-list', [
'mods' => $this->mods,
'versionScope' => $this->versionScope,
]);
}
}