codeitamarjr / laravel-appointments
A Laravel package for managing events, time slots, and appointments with features like unlimited attendees, time-framed slots, and notification management.
Requires
- php: ^8.0
- laravel/framework: ^11.0
Requires (Dev)
- mockery/mockery: ^1.5
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-04-23 10:07:00 UTC
README
Laravel Appointments is a package for managing appointments in your Laravel application. It provides a simple and flexible way to handle appointment scheduling, rescheduling, and cancellations.
Installation
To install the package, use Composer:
composer require codeitamarjr/laravel-appointments
After installing the package, publish the configuration file:
php artisan vendor:publish --provider="Codeitamarjr\LaravelAppointments\LaravelAppointmentServiceProvider" --tag=config php artisan vendor:publish --provider="Codeitamarjr\LaravelAppointments\LaravelAppointmentServiceProvider" --tag=migrations
Optionally, you can publish the factories and tests:
php artisan vendor:publish --provider="Codeitamarjr\LaravelAppointments\LaravelAppointmentServiceProvider" --tag=factories
php artisan vendor:publish --tag=tests
Run the migrations to create the necessary database tables:
php artisan migrate
Run the database seeds to populate the database with sample data:
php artisan db:seed --class=Codeitamarjr\\LaravelAppointments\\Database\\Seeders\\EventSeeder
Usage
Creating an Appointment
To create an appointment, use the Appointment
model:
use CodeItamarJr\LaravelAppointments\Models\Appointment; $appointment = Appointment::create([ 'user_id' => $userId, 'start_time' => '2023-10-01 10:00:00', 'end_time' => '2023-10-01 11:00:00', 'description' => 'Consultation', ]);
Rescheduling an Appointment
To reschedule an appointment, update the start_time
and end_time
fields:
$appointment->update([ 'start_time' => '2023-10-01 12:00:00', 'end_time' => '2023-10-01 13:00:00', ]);
Cancelling an Appointment
To cancel an appointment, delete the record:
$appointment->delete();
Configuration
You can customize the package by editing the configuration file located at config/laravel-appointments.php
.
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.
License
This package is open-sourced software licensed under the MIT license.