Tampilan superadmin dan fungsi hapus venue

This commit is contained in:
Stephen Gesityan 2025-05-12 18:53:19 +07:00
parent 4b2325d496
commit ca61a6b0fe
4 changed files with 390 additions and 233 deletions

View File

@ -150,18 +150,30 @@ public function update(Request $request, $id)
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function destroy($id) public function destroy($id)
{ {
$venue = Venue::findOrFail($id); $venue = Venue::findOrFail($id);
// Delete the venue image if exists // Hapus gambar venue jika ada
if ($venue->image && Storage::disk('public')->exists($venue->image)) { if ($venue->image && Storage::disk('public')->exists($venue->image)) {
Storage::disk('public')->delete($venue->image); Storage::disk('public')->delete($venue->image);
}
$venue->tables()->delete();
$venue->delete();
return redirect()->route('superadmin.venue.index')
->with('success', 'Venue berhasil dihapus!');
} }
// Ambil semua meja yang ada di venue ini
$tables = $venue->tables;
// Hapus semua bookings yang terkait dengan meja-meja ini
foreach ($tables as $table) {
$table->bookings()->delete(); // pastikan relasi bookings ada di model Table
}
// Hapus semua meja dari venue
$venue->tables()->delete();
// Hapus venue-nya
$venue->delete();
return redirect()->route('superadmin.venue.index')
->with('success', 'Venue berhasil dihapus!');
}
} }

View File

@ -46,13 +46,7 @@ class="flex items-center p-3 rounded-lg hover:bg-blue-700 {{ request()->routeIs(
<span class="ml-3">Dashboard</span> <span class="ml-3">Dashboard</span>
</a> </a>
</li> </li>
<li class="mb-2">
<a href="{{ route('superadmin.admin.index') }}"
class="flex items-center p-3 rounded-lg hover:bg-blue-700 {{ request()->routeIs('superadmin.admin.*') ? 'bg-blue-700' : '' }}">
<i class="fas fa-users-cog w-5"></i>
<span class="ml-3">Manajemen Admin</span>
</a>
</li>
<li class="mb-2"> <li class="mb-2">
<a href="{{ route('superadmin.venue.index') }}" <a href="{{ route('superadmin.venue.index') }}"
class="flex items-center p-3 rounded-lg hover:bg-blue-700 {{ request()->routeIs('superadmin.venue.*') ? 'bg-blue-700' : '' }}"> class="flex items-center p-3 rounded-lg hover:bg-blue-700 {{ request()->routeIs('superadmin.venue.*') ? 'bg-blue-700' : '' }}">
@ -60,6 +54,13 @@ class="flex items-center p-3 rounded-lg hover:bg-blue-700 {{ request()->routeIs(
<span class="ml-3">Manajemen Venue</span> <span class="ml-3">Manajemen Venue</span>
</a> </a>
</li> </li>
<li class="mb-2">
<a href="{{ route('superadmin.admin.index') }}"
class="flex items-center p-3 rounded-lg hover:bg-blue-700 {{ request()->routeIs('superadmin.admin.*') ? 'bg-blue-700' : '' }}">
<i class="fas fa-users-cog w-5"></i>
<span class="ml-3">Manajemen Admin</span>
</a>
</li>
<li class="mb-2"> <li class="mb-2">
<a href="{{ route('logout') }}" <a href="{{ route('logout') }}"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"

View File

@ -1,101 +1,218 @@
@extends('layouts.super-admin') @extends('layouts.super-admin')
@section('content') @section('content')
<div class="mb-6"> <div class="min-h-screen bg-gray-50 flex items-center justify-center px-4 sm:px-6 lg:px-8 py-12">
<h1 class="text-3xl font-bold text-gray-800">Tambah Admin</h1> <div class="w-full max-w-2xl">
<p class="text-gray-600">Tambahkan akun admin baru untuk venue</p> <div class="bg-white rounded-xl shadow-2xl overflow-hidden" style="backdrop-filter: blur(20px); background-color: rgba(255, 255, 255, 0.8);">
</div> <div class="p-6 sm:p-10">
<h2 class="text-center text-4xl font-semibold text-gray-900 mb-8">
{{ __('Tambah Admin Baru') }}
</h2>
<div class="bg-white rounded-lg shadow p-6"> @if ($errors->any())
<form action="{{ route('superadmin.admin.store') }}" method="POST"> <div class="mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded-lg">
@csrf <ul class="space-y-1 text-sm text-red-700">
@foreach ($errors->all() as $error)
<li class="flex items-center">
<svg class="h-4 w-4 mr-2 text-red-500" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-11.293a1 1 0 00-1.414-1.414L10 8.586 7.707 6.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 101.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293z" clip-rule="evenodd"/>
</svg>
{{ $error }}
</li>
@endforeach
</ul>
</div>
@endif
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <form
<!-- Nama Admin --> action="{{ route('superadmin.admin.store') }}"
<div> method="POST"
<label for="name" class="block text-sm font-medium text-gray-700 mb-1">Nama Admin</label> x-data="adminForm()"
<input type="text" name="name" id="name" value="{{ old('name') }}" class="space-y-6"
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 @error('name') border-red-300 @enderror" >
required> @csrf
@error('name')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Email --> <div class="grid md:grid-cols-2 gap-6">
<div> {{-- Nama Admin --}}
<label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label> <div class="col-span-2 md:col-span-1">
<input type="email" name="email" id="email" value="{{ old('email') }}" <label for="name" class="block text-sm font-medium text-gray-700 mb-2">
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 @error('email') border-red-300 @enderror" {{ __('Nama Admin') }}
required> </label>
@error('email') <input
<p class="mt-1 text-sm text-red-600">{{ $message }}</p> type="text"
@enderror id="name"
</div> name="name"
value="{{ old('name') }}"
required
autocomplete="name"
autofocus
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
placeholder="Masukkan nama admin"
>
</div>
<!-- Password --> {{-- Email --}}
<div> <div class="col-span-2 md:col-span-1">
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label> <label for="email" class="block text-sm font-medium text-gray-700 mb-2">
<input type="password" name="password" id="password" {{ __('Email') }}
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 @error('password') border-red-300 @enderror" </label>
required> <input
@error('password') type="email"
<p class="mt-1 text-sm text-red-600">{{ $message }}</p> id="email"
@enderror name="email"
</div> value="{{ old('email') }}"
required
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
placeholder="Masukkan email admin"
>
</div>
</div>
<!-- Konfirmasi Password --> <div class="grid md:grid-cols-2 gap-6">
<div> {{-- Password --}}
<label for="password_confirmation" class="block text-sm font-medium text-gray-700 mb-1">Konfirmasi <div>
Password</label> <label for="password" class="block text-sm font-medium text-gray-700 mb-2">
<input type="password" name="password_confirmation" id="password_confirmation" {{ __('Password') }}
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500" </label>
required> <div class="relative">
</div> <input
type="password"
id="password"
name="password"
required
x-bind:type="showPassword ? 'text' : 'password'"
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
placeholder="Masukkan password"
>
<button
type="button"
@click="togglePasswordVisibility()"
class="absolute inset-y-0 right-0 pr-3 flex items-center text-sm leading-5"
>
<svg x-show="!showPassword" class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
</svg>
<svg x-show="showPassword" class="h-5 w-5 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</button>
</div>
</div>
<!-- Venue --> {{-- Konfirmasi Password --}}
<div> <div>
<label for="venue_id" class="block text-sm font-medium text-gray-700 mb-1">Venue</label> <label for="password_confirmation" class="block text-sm font-medium text-gray-700 mb-2">
<select name="venue_id" id="venue_id" {{ __('Konfirmasi Password') }}
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 @error('venue_id') border-red-300 @enderror" </label>
required> <div class="relative">
<option value="">-- Pilih Venue --</option> <input
@foreach($venues as $venue) type="password"
<option value="{{ $venue->id }}" {{ old('venue_id') == $venue->id ? 'selected' : '' }}> id="password_confirmation"
{{ $venue->name }} name="password_confirmation"
</option> required
@endforeach x-bind:type="showConfirmPassword ? 'text' : 'password'"
</select> class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
@error('venue_id') placeholder="Konfirmasi password"
<p class="mt-1 text-sm text-red-600">{{ $message }}</p> >
@enderror <button
</div> type="button"
@click="toggleConfirmPasswordVisibility()"
class="absolute inset-y-0 right-0 pr-3 flex items-center text-sm leading-5"
>
<svg x-show="!showConfirmPassword" class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
</svg>
<svg x-show="showConfirmPassword" class="h-5 w-5 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</button>
</div>
</div>
</div>
<!-- Role (defaultnya Admin, tapi bisa diganti) --> <div class="grid md:grid-cols-2 gap-6">
<div> {{-- Venue --}}
<label for="role" class="block text-sm font-medium text-gray-700 mb-1">Role</label> <div>
<select name="role" id="role" <label for="venue_id" class="block text-sm font-medium text-gray-700 mb-2">
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 @error('role') border-red-300 @enderror" {{ __('Venue') }}
required> </label>
<option value="admin" {{ old('role') == 'admin' ? 'selected' : '' }}>Admin</option> <select
<option value="user" {{ old('role') == 'user' ? 'selected' : '' }}>User</option> id="venue_id"
</select> name="venue_id"
@error('role') required
<p class="mt-1 text-sm text-red-600">{{ $message }}</p> class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
@enderror >
<option value="">-- Pilih Venue --</option>
@foreach($venues as $venue)
<option
value="{{ $venue->id }}"
{{ old('venue_id') == $venue->id ? 'selected' : '' }}
>
{{ $venue->name }}
</option>
@endforeach
</select>
</div>
{{-- Role --}}
<div>
<label for="role" class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Role') }}
</label>
<select
id="role"
name="role"
required
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
>
<option value="admin" {{ old('role') == 'admin' ? 'selected' : '' }}>
Admin
</option>
<option value="user" {{ old('role') == 'user' ? 'selected' : '' }}>
User
</option>
</select>
</div>
</div>
{{-- Tombol Aksi --}}
<div class="flex justify-end space-x-4 pt-6">
<a
href="{{ route('superadmin.admin.index') }}"
class="px-6 py-3 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg font-medium transition duration-300 ease-in-out"
>
{{ __('Batal') }}
</a>
<button
type="submit"
class="px-6 py-3 bg-blue-500 text-white rounded-lg font-medium hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300 ease-in-out"
>
{{ __('Simpan') }}
</button>
</div>
</form>
</div> </div>
</div> </div>
</div>
<div class="mt-6 flex items-center justify-end">
<a href="{{ route('superadmin.admin.index') }}"
class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Batal
</a>
<button type="submit"
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Simpan
</button>
</div>
</form>
</div> </div>
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
<script>
function adminForm() {
return {
showPassword: false,
showConfirmPassword: false,
togglePasswordVisibility() {
this.showPassword = !this.showPassword;
},
toggleConfirmPasswordVisibility() {
this.showConfirmPassword = !this.showConfirmPassword;
}
}
}
</script>
@endpush
@endsection @endsection

View File

@ -1,142 +1,169 @@
@extends('layouts.super-admin') @extends('layouts.super-admin')
@section('content') @section('content')
<div class="container"> <div class="min-h-screen bg-gray-50 flex items-center justify-center px-4 sm:px-6 lg:px-8 py-12">
<div class="row justify-content-center"> <div class="w-full max-w-2xl">
<div class="col-md-8"> <div class="bg-white rounded-xl shadow-2xl overflow-hidden"
<div class="card"> style="backdrop-filter: blur(20px); background-color: rgba(255, 255, 255, 0.8);">
<div class="card-header">{{ __('Tambah Venue Baru') }}</div> <div class="p-6 sm:p-10">
<h2 class="text-center text-4xl font-semibold text-gray-900 mb-8">
{{ __('Tambah Venue Baru') }}
</h2>
<div class="card-body"> @if ($errors->any())
@if ($errors->any()) <div class="mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded-lg">
<div class="alert alert-danger"> <ul class="space-y-1 text-sm text-red-700">
<ul> @foreach ($errors->all() as $error)
@foreach ($errors->all() as $error) <li class="flex items-center">
<li>{{ $error }}</li> <svg class="h-4 w-4 mr-2 text-red-500" fill="currentColor" viewBox="0 0 20 20">
@endforeach <path fill-rule="evenodd"
</ul> d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-11.293a1 1 0 00-1.414-1.414L10 8.586 7.707 6.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 101.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293z"
clip-rule="evenodd" />
</svg>
{{ $error }}
</li>
@endforeach
</ul>
</div>
@endif
<form method="POST" action="{{ route('superadmin.venue.store') }}" enctype="multipart/form-data"
x-data="venueForm()" class="space-y-6">
@csrf
<div class="grid md:grid-cols-2 gap-6">
{{-- Nama Venue --}}
<div class="col-span-2 md:col-span-1">
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Nama Venue') }}
</label>
<input type="text" id="name" name="name" value="{{ old('name') }}" required
autocomplete="name" autofocus
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
placeholder="Masukkan nama venue">
</div> </div>
@endif
<form method="POST" action="{{ route('superadmin.venue.store') }}" enctype="multipart/form-data"> {{-- Nomor Telepon --}}
@csrf <div class="col-span-2 md:col-span-1">
<label for="phone" class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Nomor Telepon') }}
</label>
<input type="tel" id="phone" name="phone" value="{{ old('phone') }}" required
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
placeholder="Masukkan nomor telepon">
</div>
</div>
<div class="form-group row mb-3"> {{-- Alamat --}}
<label for="name" <div>
class="col-md-4 col-form-label text-md-right">{{ __('Nama Venue') }}</label> <label for="address" class="block text-sm font-medium text-gray-700 mb-2">
<div class="col-md-6"> {{ __('Alamat') }}
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" </label>
name="name" value="{{ old('name') }}" required autocomplete="name" autofocus> <textarea id="address" name="address" required rows="3"
@error('name') class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
<span class="invalid-feedback" role="alert"> placeholder="Masukkan alamat lengkap venue">{{ old('address') }}</textarea>
<strong>{{ $message }}</strong> </div>
</span>
@enderror {{-- Deskripsi --}}
<div>
<label for="description" class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Deskripsi') }}
</label>
<textarea id="description" name="description" rows="4" required
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out"
placeholder="Berikan deskripsi venue">{{ old('description') }}</textarea>
</div>
{{-- Jam Operasional --}}
<div class="grid md:grid-cols-2 gap-6">
<div>
<label for="open_time" class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Jam Buka') }}
</label>
<input type="time" id="open_time" name="open_time" value="{{ old('open_time') }}" required
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out">
</div>
<div>
<label for="close_time" class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Jam Tutup') }}
</label>
<input type="time" id="close_time" name="close_time" value="{{ old('close_time') }}"
required
class="block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300 ease-in-out">
</div>
</div>
{{-- Upload Gambar --}}
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
{{ __('Gambar Venue') }}
</label>
<div x-ref="dropzone" @dragover.prevent="dragover = true" @dragleave.prevent="dragover = false"
@drop.prevent="handleDrop($event)"
class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg transition duration-300 ease-in-out"
:class="dragover ? 'border-blue-500 bg-blue-50' : 'hover:border-blue-500'">
<div class="space-y-1 text-center">
<svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none"
viewBox="0 0 48 48" aria-hidden="true">
<path
d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<div class="flex text-sm text-gray-600 justify-center">
<label for="image"
class="relative cursor-pointer rounded-md font-medium text-blue-600 hover:text-blue-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-blue-500">
<span>{{ __('Unggah file') }}</span>
<input id="image" name="image" type="file" class="sr-only" accept="image/*"
@change="handleFileSelect($event)">
</label>
<p class="pl-1">{{ __('atau seret dan lepas') }}</p>
</div>
<p class="text-xs text-gray-500">
{{ __('PNG, JPG, GIF hingga 2MB') }}
</p>
<p x-text="fileName" class="text-sm text-gray-600 mt-2"></p>
</div> </div>
</div> </div>
</div>
<div class="form-group row mb-3"> {{-- Tombol Aksi --}}
<label for="address" <div class="flex justify-end space-x-4 pt-6">
class="col-md-4 col-form-label text-md-right">{{ __('Alamat') }}</label> <a href="{{ route('superadmin.venue.index') }}"
<div class="col-md-6"> class="px-6 py-3 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg font-medium transition duration-300 ease-in-out">
<textarea id="address" class="form-control @error('address') is-invalid @enderror" {{ __('Batal') }}
name="address" required>{{ old('address') }}</textarea> </a>
@error('address') <button type="submit"
<span class="invalid-feedback" role="alert"> class="px-6 py-3 bg-blue-500 text-white rounded-lg font-medium hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300 ease-in-out">
<strong>{{ $message }}</strong> {{ __('Simpan') }}
</span> </button>
@enderror </div>
</div> </form>
</div>
<div class="form-group row mb-3">
<label for="phone"
class="col-md-4 col-form-label text-md-right">{{ __('Nomor Telepon') }}</label>
<div class="col-md-6">
<input id="phone" type="text" class="form-control @error('phone') is-invalid @enderror"
name="phone" value="{{ old('phone') }}" required>
@error('phone')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row mb-3">
<label for="description"
class="col-md-4 col-form-label text-md-right">{{ __('Deskripsi') }}</label>
<div class="col-md-6">
<textarea id="description"
class="form-control @error('description') is-invalid @enderror" name="description"
rows="4" required>{{ old('description') }}</textarea>
@error('description')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row mb-3">
<label for="open_time"
class="col-md-4 col-form-label text-md-right">{{ __('Jam Buka') }}</label>
<div class="col-md-6">
<input id="open_time" type="time"
class="form-control @error('open_time') is-invalid @enderror" name="open_time"
value="{{ old('open_time') }}" required>
@error('open_time')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row mb-3">
<label for="close_time"
class="col-md-4 col-form-label text-md-right">{{ __('Jam Tutup') }}</label>
<div class="col-md-6">
<input id="close_time" type="time"
class="form-control @error('close_time') is-invalid @enderror" name="close_time"
value="{{ old('close_time') }}" required>
@error('close_time')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row mb-3">
<label for="image"
class="col-md-4 col-form-label text-md-right">{{ __('Gambar Venue') }}</label>
<div class="col-md-6">
<input id="image" type="file" class="form-control @error('image') is-invalid @enderror"
name="image" accept="image/*" required>
<small class="form-text text-muted">Format: JPG, PNG, GIF. Ukuran maksimal: 2MB</small>
@error('image')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Simpan') }}
</button>
<a href="{{ route('superadmin.venue.index') }}" class="btn btn-secondary">
{{ __('Batal') }}
</a>
</div>
</div>
</form>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
<script>
function venueForm() {
return {
dragover: false,
fileName: '',
handleFileSelect(event) {
const file = event.target.files[0];
this.fileName = file ? file.name : '';
},
handleDrop(event) {
this.dragover = false;
const file = event.dataTransfer.files[0];
if (file) {
document.getElementById('image').files = event.dataTransfer.files;
this.fileName = file.name;
}
}
}
}
</script>
@endpush
@endsection @endsection