@extends('admin.layout') @section('title', 'Community posts') @section('content') @php $sortLink = function(string $column, string $label) use ($sort, $dir): string { $newDir = ($sort === $column && $dir === 'asc') ? 'desc' : 'asc'; $arrow = $sort === $column ? ($dir === 'asc' ? ' ↑' : ' ↓') : ''; $url = route('admin.posts.index', array_merge(request()->query(), ['sort' => $column, 'dir' => $newDir])); return '' . $label . $arrow . ''; }; @endphp {{-- Filters --}}
{{-- Table --}}| {!! $sortLink('id', 'ID') !!} | Gebruiker | Inhoud | {!! $sortLink('created_at', 'Geplaatst') !!} | |
|---|---|---|---|---|
| {{ $post->id }} |
@if ($post->user)
#{{ $post->user->id }} {{ $post->user->name }}
{{ $post->user->email }} @else Verwijderd @endif |
{{ $post->body }} |
{{ $post->created_at->diffForHumans() }} | |
| Geen posts gevonden. | ||||