12345678910111213141516171819202122232425262728293031323334353637383940 |
- {{--<x-app-layout>--}}
- {{-- <x-slot name="header">--}}
- {{-- <h2 class="font-semibold text-xl text-gray-800 leading-tight">--}}
- {{-- 文章列表--}}
- {{-- </h2>--}}
- {{-- </x-slot>--}}
- <div class="py-12">
- <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
- <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
- <div class="flex justify-center">
- <table class="w-full m-8">
- <thead>
- <tr>
- <th class="px-4 py-2">ID</th>
- <th class="px-4 py-2">Title</th>
- <th class="px-4 py-2">Author</th>
- <th class="px-4 py-2">Created At</th>
- </tr>
- </thead>
- <tbody>
- @foreach ($posts as $post)
- <tr>
- <td class="border px-4 py-2">{{ $post->id }}</td>
- <td class="border px-4 py-2">{{ $post->title }}</td>
- <td class="border px-4 py-2">{{ $post->author->name }}</td>
- <td class="border px-4 py-2">{{ $post->created_at->diffForHumans() }}</td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- <div class="max-w-full m-8">
- {{ $posts->links() }}
- </div>
- </div>
- </div>
- </div>
- {{--</x-app-layout>--}}
|