Hotel Bookings and Hotel Management

Filament 4/5

This project demonstrates multiple panels in one Filament application: one for hotel management, and another for search and book hotel rooms.

FilamentExamples ThumbBase (2)

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Hotel Bookings and Hotel Management
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 173 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 173 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

In this Filament Example project, we have two panels:

  • Hotel, for managing hotel with rooms.
  • Booking, for making a room booking.

When a user registers to any panel, they are automatically assigned a role based on the panel. It is done in Eloquent Events closures method in the User Model.

protected static function booted(): void
{
static::created(function (User $user) {
if (filament()->getCurrentOrDefaultPanel()->getId() === 'hotel') {
$user->assignRole('hotels');
}
if (filament()->getCurrentOrDefaultPanel()->getId() === 'booking') {
$user->assignRole('customers');
}
});
}

According to the role, the user gets access to a panel.

public function canAccessPanel(Panel $panel): bool
{
if ($panel->getId() === 'hotel' && $this->hasRole('hotels')) {
return true;
}
 
if ($panel->getId() === 'booking' && $this->hasRole('customers')) {
return true;
}
 
return false;
}

Hotel Panel

In the hotel panel, we have a custom page, MyHotel, where users can manage information about their hotel. It is a HasOne relation to the Hotel Model.

public function hotel(): HasOne
{
return $this->hasOne(Hotel::class);
}

Next, in this example, we will:

  • Build out the Hotel Management
  • Build the Room Management
  • Build a Global Panel to overview Bookings and Rooms
  • Building a page to Book a Room
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.