mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
feat: add recent skins to home
This commit is contained in:
17
app/Http/Controllers/HomeController.php
Normal file
17
app/Http/Controllers/HomeController.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\ChampionSkin;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$skins = ChampionSkin::orderBy('release_date', 'desc')->get();
|
||||
|
||||
return view('home', [
|
||||
'skins' => $skins,
|
||||
]);
|
||||
}
|
||||
}
|
||||
26
app/View/Components/home/recent_skins.php
Normal file
26
app/View/Components/home/recent_skins.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\home;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class recent_skins extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public array $skins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.home.recent_skins');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user