Schedule for Doctors

Filament 4/5

This project demonstrates a doctor's schedule management system. It allows administrators to manage doctors across multiple clinics, set their availability rules, and block time periods for various reasons, such as holidays or conferences.

FilamentExamples ThumbBase (3)

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Schedule for Doctors
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 172 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 172 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 project, we make use of the laraveljutsu/zap package to manage doctor schedules across multiple clinics. The system allows administrators to set availability rules and block time periods for doctors.

Core Models and Relationships

The system uses three main models with many-to-many relationships:

app/Models/User.php (Doctor):

use Zap\Models\Concerns\HasSchedules;
 
class User extends Authenticatable
{
use HasFactory, Notifiable, HasSchedules;
 
public function clinics(): BelongsToMany
{
return $this->belongsToMany(Clinic::class);
}
 
public function specialties(): BelongsToMany
{
return $this->belongsToMany(Specialty::class);
}
 
public function isDoctor(): bool
{
return $this->role === 'doctor';
}
}

The HasSchedules trait from the Zap package provides the relationship to schedules and schedule periods.

Schedule Management with Zap Package

The main schedule management happens in the custom Filament page ManageDoctorSchedule. This page demonstrates two key features of the Zap package:

  1. Creating Availability Rules - Regular working hours for doctors
  2. Creating Blocked Periods - Time when doctors are unavailable

app/Filament/Pages/ManageDoctorSchedule.php:

use Zap\Facades\Zap;
 
public function createAvailabilityRule(array $data): void
{
Zap::for($this->selectedDoctor)
->named('Availability Rule')
->availability()
->from($data['effective_from'])
->to($data['effective_to'])
// ...

Next, we will build:

  • Schedule Displays
  • Working Hours
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.