Skip to content
Braden Keith edited this page Sep 20, 2025 · 3 revisions

Romega Software - Availability Wiki

Welcome to the Romega Software - Availability documentation. This package provides a powerful, rule-based availability engine for Laravel models, allowing you to define complex availability windows with a predictable evaluation strategy.

What is Romega Software - Availability?

Romega Software - Availability is a flexible rule engine that lets you attach availability rules to any Eloquent model. Whether you're building a booking system, scheduling tool, or resource management platform, this package provides the infrastructure to handle complex availability logic.

Key Features

  • Rule-Based System - Define multiple availability rules with different types and priorities
  • Predictable Evaluation - "Last matching rule wins" policy ensures consistent behavior
  • Timezone Aware - All evaluations respect the subject's timezone
  • Extensible - Add custom rule types and evaluators
  • Laravel Native - Built for Laravel with Eloquent integration

Quick Example

// Add availability to your model
class Room extends Model
{
    use HasAvailability;
}

// Create availability rules
$room->availabilityRules()->create([
    'type' => 'weekdays',
    'config' => ['days' => [1, 2, 3, 4, 5]], // Mon-Fri
    'effect' => 'allow',
    'priority' => 10,
]);

$room->availabilityRules()->create([
    'type' => 'time_of_day',
    'config' => ['from' => '09:00', 'to' => '17:00'], // 9 AM - 5 PM
    'effect' => 'allow',
    'priority' => 20,
]);

// Check availability
$engine = app(AvailabilityEngine::class);
if ($engine->isAvailable($room, now())) {
    // Room is available
}

Support

Getting Started

Installation
Set up the package in your Laravel app

Quick Start
Get running in 5 minutes

Basic Usage
Common patterns and examples


Core Concepts

How It Works
Understanding the evaluation engine

Rule Types
Available rule types and configurations

Priority System
How rule priority affects evaluation


Advanced Topics

Inventory Gates
Dynamic availability based on stock

Custom Evaluators
Build your own rule types

Complex Scenarios
Real-world implementation patterns

Performance Tips
Optimization strategies


API Reference

Configuration
Package configuration options

Models & Traits
Available models and traits

Testing
Testing your availability rules

Clone this wiki locally