Skip to content

Laravel package, designed for scheduling, managing, and tracking appointments.

License

RedberryProducts/laravel-appointments

Repository files navigation

laravel-appointments

Overview

This document is a comprehensive guide for the laravel-appointments Laravel package, designed for scheduling, managing, and tracking appointments.

Setup and Installation

  • Installation:

    composer require redberry/laravel-appointments
  • Publish Configuration (if applicable):

    php artisan vendor:publish --tag="laravel-appointments-config"
  • Database Migration:

    php artisan migrate

Core Functionalities

Using the Appointment Facade

  1. Schedule an Appointment

    • Schedule an appointment for a user at a specified timestamp.
    use Redberry\Appointments\Facades\Appointment;
    
    Appointment::with($doctor)->for($user)->schedule(at: $timestamp);
  2. Reschedule an Appointment

    • Change the time of an existing appointment.
    Appointment::for($user)->reschedule(at: $timestamp);
  3. Cancel an Appointment

    • Cancel a scheduled appointment.
    Appointment::for($user)->cancel();
  4. Retrieve Available Dates

    • Get dates with available appointment slots.
    $availableDates = Appointment::availableDates();
  5. Retrieve Booked Dates

    • Get dates with no available appointment slots.
    $bookedDates = Appointment::bookedDates();
  6. Available Time Slots for a Date

    • Get available time slots for a specific date.
    $availableTimeSlots = Appointment::date($date)->availableTimeslots();
  7. Booked Time Slots for a Date

    • Get booked time slots for a specific date.
    $bookedTimeSlots = Appointment::date($date)->bookedTimeslots();

Events

Available Events

The package fires several events related to appointment activities:

  1. AppointmentScheduled
  2. AppointmentReschedule
  3. AppointmentCanceled

Registering Event Listeners

Developers can listen to these events in their application's EventServiceProvider:

protected $listen = [
    \Redberry\Appointments\Events\AppointmentScheduled::class => [
        \App\Listeners\HandleAppointmentScheduled::class,
    ],
    \Redberry\Appointments\Events\AppointmentRescheduled::class => [
        \App\Listeners\HandleAppointmentRescheduled::class,
    ],
    \Redberry\Appointments\Events\AppointmentCanceled::class => [
        \App\Listeners\HandleAppointmentCanceled::class,
    ],
];

Testing

  • Pest

Development and Contributions

  • Instructions for contributing to the package, including coding standards and pull request processes.

Future Plans and Feedback

  • Outline of planned features and enhancements, and an invitation for community feedback and suggestions.

About

Laravel package, designed for scheduling, managing, and tracking appointments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  

Languages