composer require przwl/cine-reserve
php artisan vendor:publish --tag=cine-reserve-config
AdminPanelProvider.php:
->plugins([
CineReserve::make(),
])
config/cine-reserve.php with basic settings (e.g., rows, seats_per_row, colors).Display a Seat Selection UI in a Filament resource/page:
use Przwl\CineReserve\Filament\Widgets\CineReserveWidget;
public static function getWidgets(): array
{
return [
CineReserveWidget::make()
->movie('Inception')
->showPrice(true)
->maxSeats(10),
];
}
Seat Selection UI:
CineReserveWidget in Filament resources/pages.CineReserveWidget::make()
->movie('Movie Title')
->rows(10)
->seatsPerRow(8)
->colors(['available' => 'green', 'booked' => 'red'])
->showPrice(true)
->maxSeats(5)
Data Binding:
bookedSeats():
->bookedSeats(fn () => $this->getBookedSeats()) // Closure or array
->submitAction(fn (array $selectedSeats) => $this->createBooking($selectedSeats))
Dynamic Configuration:
CineReserveWidget::make()
->dynamicConfig(fn () => [
'rows' => $this->getAvailableRows(),
'seats_per_row' => $this->getSeatsPerRow(),
])
Filament Resources:
Integrate with create/edit forms for booking workflows:
use Przwl\CineReserve\Filament\Components\CineReserveComponent;
public function form(Form $form): Form
{
return $form
->schema([
CineReserveComponent::make()
->movie($this->movie->title)
->bookedSeats($this->getExistingBookings())
->submitAction(fn (array $seats) => $this->updateBookings($seats)),
]);
}
API/Backend Logic:
Use the submitAction to handle seat selection data:
->submitAction(fn (array $selectedSeats) => {
$this->validateSeats($selectedSeats);
$this->processPayment($selectedSeats);
$this->saveToDatabase($selectedSeats);
})
Theming: Extend default styles via published assets:
php artisan vendor:publish --tag=cine-reserve-assets
Override in resources/css/app.css:
.cine-reserve-seat.available { background: #4CAF50; }
Seat Indexing:
['A1', 'A2', ...]). Validate backend logic matches this format.->seatFormatter(fn ($row, $seat) => "{$row}{$seat + 1}") for 1-based display.Dark Mode Conflicts:
'gray-500') or ensure CSS variables are respected.Concurrent Bookings:
submitAction:
->submitAction(fn (array $seats) => {
if ($this->areSeatsAvailable($seats)) {
$this->bookSeats($seats);
} else {
throw new \Exception('Seats no longer available.');
}
})
Performance:
->rows(10) // Limit rows
->lazyLoad(true) // Load seats dynamically (if supported in future updates)
Log Seat Data:
Dump selected seats in submitAction:
->submitAction(fn (array $seats) => {
\Log::info('Selected seats:', $seats);
// ...
})
Check Config:
Verify config/cine-reserve.php for typos in keys like register_navigation.
Custom Seat Types: Override seat rendering via a custom component:
CineReserveWidget::make()
->seatComponent(CustomSeatComponent::class)
Example: Highlight VIP seats differently.
Validation:
Add custom rules to submitAction:
->submitAction(fn (array $seats) => {
if (count($seats) > 2) {
throw new \Exception('Maximum 2 seats allowed.');
}
})
Localization:
Extend language strings via config/cine-reserve.php:
'labels' => [
'seat_selected' => 'Your Seat',
],
Event Listeners: Listen for seat selection changes (if plugin emits events in future):
// Hypothetical future usage
event(new \Przwl\CineReserve\Events\SeatsSelected($seats));
How can I help you explore Laravel packages today?