1
0
Fork 0

Adding Admin Controller

This commit is contained in:
Henrik Hautakoski 2021-12-31 17:21:00 +01:00
parent f47bf9ca62
commit 78837efd2d
2 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Admin;
use App\Http\Controllers\Controller;
class AdminController extends Controller
{
public function index()
{
return view("admin.admin.index", [ 'items' => Admin::all() ]);
}
}

View file

@ -0,0 +1,21 @@
<x-layout name="admin">
<table class="table-fixed w-full">
<tr class="text-left border-b-2">
<th class="border px-6 py-3">Username</th>
<th class="border px-6 py-3">Created</th>
<th class="border px-6 py-3">Updated</th>
</tr>
@foreach($items as $item)
<tr class="bg-gray-100">
<td class="border px-4 py-2">{{ $item->username }}</td>
<td class="border px-4 py-2">{{ $item->created_at }}</td>
<td class="border px-4 py-2">{{ $item->updated_at }}</td>
</tr>
@endforeach
</table>
</x-layout>