Created FilamentController & Filament Model + Views
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
{{ __('Create Manufacturers') }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headeraction">
|
||||
<div class="flex gap-4 justify-end">
|
||||
<a href="{{ route('manufacturers.index') }}" class=" text-zinc-50 hover:text-zinc-300 font-bold text-base py-2 px-4 rounded cursor-pointer">Back</a>
|
||||
<a href="{{ route('manufacturers.store') }}" onclick="event.preventDefault(); document.getElementById('create-manufacturer-form').submit();" class="bg-green-500 hover:bg-green-700 text-zinc-700 hover:text-white font-bold text-base py-2 px-4 rounded cursor-pointer">Submit</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
|
||||
<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 p-4 overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<form id="create-manufacturer-form" class="flex flex-col gap-6" method="POST" action="{{ route('manufacturers.store') }}">
|
||||
@csrf
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="name" class="text-lg ">Name</label>
|
||||
<input type="text" id="name" name="name" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded" required="">
|
||||
</div>
|
||||
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="description">Description</label>
|
||||
<textarea name="description" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded"></textarea>
|
||||
</div>
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="website" class="text-lg ">Website</label>
|
||||
<input type="text" id="website" name="website" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded">
|
||||
</div>
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="logo" class="text-lg ">Logo</label>
|
||||
<input type="text" id="logo" name="logo" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded">
|
||||
</div>
|
||||
<div class="flex justify-end gap-4">
|
||||
<a href="{{ route('manufacturers.index') }}" class="bg-zinc-500 hover:bg-zinc-700 text-zinc-800 hover:text-white font-bold py-2 px-4 rounded cursor-pointer">Cancel</a>
|
||||
<button type="submit" class="bg-green-500 hover:bg-green-700 text-zinc-800 hover:text-white font-bold py-2 px-4 rounded cursor-pointer">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,34 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
{{ __('Edit Manufacturers') }}
|
||||
</x-slot>
|
||||
|
||||
|
||||
<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 p-4 overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<form id="update-manufacturer-form" class="flex flex-col gap-6" method="POST" action="{{ route('manufacturers.update', $manufacturer->id) }}">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="name" class="text-lg ">Name</label>
|
||||
<input type="text" id="name" name="name" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded" required="" value="{{ $manufacturer->name }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="description">Description</label>
|
||||
<textarea name="description" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded" value="{{ $manufacturer->description }}"></textarea>
|
||||
</div>
|
||||
<div class="form-group flex flex-col">
|
||||
<label for="website" class="text-lg ">Website</label>
|
||||
<input type="text" id="website" name="website" class="form-control bg-white dark:bg-zinc-800 border-zinc-50 dark:border-zinc-600 rounded" value="{{ $manufacturer->website }}">
|
||||
</div>
|
||||
<div class="flex justify-end gap-4">
|
||||
<a href="{{ route('manufacturers.index') }}" class="bg-zinc-500 hover:bg-zinc-700 text-zinc-800 hover:text-white font-bold py-2 px-4 rounded cursor-pointer">Cancel</a>
|
||||
<button type="submit" class="bg-green-500 hover:bg-green-700 text-zinc-800 hover:text-white font-bold py-2 px-4 rounded cursor-pointer">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,30 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
{{ __('Manufacturers') }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headeraction">
|
||||
<div class="flex gap-4 justify-end">
|
||||
<a href="{{ route('manufacturers.create') }}" class="bg-zinc-500 hover:bg-green-500 text-zinc-50 hover:text-zinc-700 font-bold text-base py-2 px-4 rounded cursor-pointer">Create</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<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="">ID</div><div class="">Name</div><div class="">Options</div></li>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<li class="flex gap-6 py-3 px-4 items-center">
|
||||
<div class="p-2">{{ $manufacturer->id }}</div>
|
||||
<div class="p-2"><a href="/manufacturers/{{ $manufacturer->id }}">{{ $manufacturer->name }}</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>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,35 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
{{ $manufacturer->name }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headeraction">
|
||||
<div class="flex gap-4 justify-end">
|
||||
<a href="{{ route('manufacturers.index') }}" class=" text-zinc-50 hover:text-zinc-300 font-bold text-base py-2 px-4 rounded cursor-pointer">Back</a>
|
||||
<a href="{{ route('manufacturers.edit', $manufacturer->id) }}" class="bg-zinc-500 hover:bg-zinc-700 text-zinc-50 hover:text-white font-bold text-base py-2 px-4 rounded cursor-pointer">Edit</a>
|
||||
<a href="{{ route('manufacturers.destroy', $manufacturer->id) }}" onclick="event.preventDefault(); document.getElementById('delete-form-{{ $manufacturer->id }}').submit();" class="bg-red-500 hover:bg-red-500 text-zinc-50 hover:text-white font-bold text-base py-2 px-4 rounded cursor-pointer">Delete</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<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">
|
||||
<div class="p-4">
|
||||
<div class="text-lg font-bold">Description</div>
|
||||
<div class="p-4">
|
||||
{{ $manufacturer->description }}
|
||||
</div>
|
||||
<div class="text-lg font-bold">Website</div>
|
||||
<div class="p-4">
|
||||
<a href="{{ $manufacturer->website }}" class="flex gap-2" target="_blank">{{ $manufacturer->website }}<flux:icon.arrow-top-right-on-square /></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="delete-form-{{ $manufacturer->id }}" method="POST" action="{{ route('manufacturers.destroy', $manufacturer->id) }}" class="hidden">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user