This Laravel-based web application provides a babysitter reservation system where customers can book babysitting services for their children. The system includes validation of reservation details, handling of customer and children information, and management of recurring bookings.
- Customer booking form with datetime selection and children details
- No Login Required for Initial Booking
- Address information and special instructions handling
- Automated booking number generation
- Age validation for children (1 month to 12 years and 11 months)
- Comprehensive validation rules for booking dates and times
- Status tracking of babysitting requests
- Backend: Laravel (PHP)
- Frontend: Vue.js with Inertia.js
- Database: MySQL/PostgreSQL
- CSS Framework: Tailwind CSS
- Authentication: Laravel Breeze with Inertia
The system uses the following data models:
Stores the core booking information including customer details, booking times, and status.
Stores all the status for lookup instead of enums.
Stores information about the children requiring care, including age validation.
Stores user authentication details with role-based permissions (customer, support, admin).
These configurations ensure that the application follows best practices for security, performance, and development discipline across all environments.
private function configureCommands(): void- Prevents destructive database commands in production environments
- Provides an extra layer of safety for database operations
- Helps prevent accidental data loss in production databases
private function configureModels(): voidModel::shouldBeStrict(): Enables strict mode for all Eloquent models, which helps catch common mistakes like accessing non-existent attributesModel::unguard(): Disables mass assignment protection across all models, allowing for mass assignment without specifying$fillableproperties (note: this requires careful validation of input data)
private function configureUrl(): void- Forces HTTPS for all URLs generated by the application in non-local environments
- Ensures secure connections for all data transmissions
- Maintains HTTP in local development for convenience
private function configureVite(): void- Configures Vite.js (Laravel's frontend build tool since v11.12)
- Uses "aggressive" prefetching strategy which preloads resources proactively
- Improves the perceived performance of the application by reducing load times
Allows customers to:
- Select start and end date/time for babysitting
- Enter their contact information (name, email, phone)
- Input address details
- Add children's information (up to 4 children)
- Set up recurring booking patterns (optional)
- Include special instructions or messages
Validation Rules:
- Reservations must be at least 6 hours in advance
- Reservations must be within 30 days from the current date
- Maximum 4 children per booking
- Children must be between 1 month and 12 years and 11 months old
Shows a summary of all entered information:
- Customer contact details
- Address information
- Babysitting date and time
- Children's information
- Recurring pattern details (if applicable)
- Submit button to confirm the reservation
Displays booking confirmation with:
- Unique booking number (format: BKS-YYYYMMDD-XXXX)
- Summary of all booking details
- Current status of the booking (initially "Pending")
- Contact information for further inquiries
- Customer submits a booking request
- System generates a unique booking number
- Request status is set to "Pending"
- Customer support is notified of new booking (WIP)
- Support staff can assign, confirm, or cancel requests (WIP)
- Status updates are communicated to the customer (WIP)
The frontend is built using Vue.js components rendered through Inertia.js, providing a modern single-page application experience while leveraging Laravel's backend capabilities:
- Inertia.js: Connects the Laravel backend with Vue frontend without building a separate API
- Vue Components: Modular, reusable components for forms, validation, and UI elements
- Vue Router: Handled implicitly by Inertia.js for page navigation
- Form Handling: Using Inertia Forms with validation
- State Management: Component and page-level state with props from the server
# Clone the repository
git clone https://github.com/azri-cs/kiddycare.git
cd kiddycare
# Install dependencies
composer install
npm install
# Set up environment variables
cp .env.example .env
php artisan key:generate
# Configure your database in .env file
# Run migrations
php artisan migrate
# Seed the database (optional)
php artisan db:seed
# Compile assets and watch for changes
npm run dev
# Start the server
php artisan serveImportant directories for the Vue/Inertia implementation:
- app/
- Http/
- Controllers/
- Requests/ # Form validation requests
- resources/
- js/
- Components/ # Vue components
- Layouts/ # Page layouts
- Pages/ # Inertia page components
- css/
- routes/
- web.php # Application routes
This project is licensed under the MIT License - see the LICENSE file for details.