mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
26 lines
576 B
PHP
26 lines
576 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use CreativeCrafts\Paginate\Facades\Paginate;
|
|
use Spatie\Sheets\Facades\Sheets;
|
|
use Spatie\Sheets\Sheet;
|
|
|
|
class PostsController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$posts = Sheets::all()->filter(fn ($post) => ! $post->hidden)->sortByDesc('date');
|
|
$paginatedPosts = Paginate::collection($posts, 6);
|
|
|
|
return view('posts.index', [
|
|
'posts' => $paginatedPosts,
|
|
]);
|
|
}
|
|
|
|
public function show(Sheet $post)
|
|
{
|
|
return view('posts.show', ['post' => $post]);
|
|
}
|
|
}
|