updated manufacturer.index
This commit is contained in:
@@ -15,8 +15,7 @@ class ManufacturerController extends Controller
|
||||
{
|
||||
// show all manufacturers
|
||||
$manufacturers = Manufacturer::all()->sortBy('name');
|
||||
$filamentcount = Filament::all()->count();
|
||||
return view('manufacturers.index', compact('manufacturers', 'filamentcount'));
|
||||
return view('manufacturers.index', compact('manufacturers'));
|
||||
}
|
||||
|
||||
public static function refresh()
|
||||
|
||||
@@ -13,7 +13,8 @@ class Manufacturer extends Model
|
||||
'name',
|
||||
'description',
|
||||
'website',
|
||||
'logo'
|
||||
'logo',
|
||||
'filament_count'
|
||||
];
|
||||
|
||||
// Manufacturer has many filaments
|
||||
|
||||
@@ -12,17 +12,30 @@
|
||||
<div class="py-12">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||
<div class="bg-white dark:bg-zinc-700 overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<ul class="">
|
||||
<li class="flex gap-6 bg-zinc-50 dark:bg-zinc-900 p-2 px-4"><div class="">Name</div><div class="">Options</div></li>
|
||||
|
||||
<table class="table-auto w-full">
|
||||
<thead class="bg-zinc-900 border-b border-rose-500">
|
||||
<tr>
|
||||
<th class="py-6">Name</th>
|
||||
<th class="py-6">Count</th>
|
||||
<th class="py-6">Website</th>
|
||||
<th class="py-6">Edit</th>
|
||||
<th class="py-6">Delete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<li class="flex gap-6 py-3 px-4 items-center">
|
||||
<div class="p-2"><a href="/manufacturers/{{ $manufacturer->id }}">{{ $manufacturer->name }}</a></div>
|
||||
<div class="p-2"><a href="/manufacturers/{{ $manufacturer->id }}" class="bg-accent px-2 py-1 rounded">{{ $filamentcount }}</a></div>
|
||||
<div class="p-2"><a class="flex gap-2" target="_blank" href="{{ $manufacturer->website }}">{{ $manufacturer->website }}<flux:icon.arrow-top-right-on-square /></a></div>
|
||||
<div class="px-2"><a href="{{ route('manufacturers.edit', $manufacturer->id) }}"><flux:icon.ellipsis class="hover:text-zinc-50 hover:bg-zinc-500 stroke-3 rounded "/></a></div>
|
||||
</li>
|
||||
<tr class="border-b border-zinc-600">
|
||||
<td class="text-center py-4"><a href="/manufacturers/{{ $manufacturer->id }}" class="flex justify-center">{{ $manufacturer->name }}</a></td>
|
||||
<td class="text-center py-4"><a href="/manufacturers/{{ $manufacturer->id }}" class="bg-accent px-2 py-1 rounded">{{ $manufacturer->filament_count }}</a></td>
|
||||
<td class="text-center py-4"><a class="flex gap-2 justify-center" target="_blank" href="{{ $manufacturer->website }}">{{ $manufacturer->website }}<flux:icon.arrow-top-right-on-square /></a></td>
|
||||
<td class="text-center py-4"><a href="{{ route('manufacturers.edit', $manufacturer->id) }}" class="flex justify-center"><flux:icon.ellipsis class="hover:text-zinc-50 hover:bg-zinc-500 stroke-3 rounded "/></a></td>
|
||||
<td class="text-center py-4"><a href="{{ route('manufacturers.edit', $manufacturer->id) }}" class="flex justify-center"><flux:icon.x-mark class="hover:text-zinc-50 hover:bg-zinc-500 stroke-3 rounded "/></a></td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</ul>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user