Skip to content

Installation

Braden Keith edited this page Sep 21, 2025 · 3 revisions

Installation

Requirements

  • PHP 8.4 or higher
  • Laravel 12.0 or higher
  • A configured database connection

Install via Composer

Install the package using Composer:

composer require romegasoftware/availability

The service provider will auto-register with Laravel's package discovery.

Database Setup

Run the migrations to create the availability rules table:

php artisan migrate

This creates the availability_rules table with the following structure:

  • Polymorphic relationship columns (subject_type, subject_id)
  • Rule configuration (type, config, effect)
  • Management fields (priority, enabled)
  • Standard timestamps

Optional: Publish Configuration

If you need to customize the package configuration:

php artisan vendor:publish --tag=availability-config

This publishes the configuration file to config/availability.php.

Optional: Publish Migrations

If you need to customize the migration:

php artisan vendor:publish --tag=availability-migrations

This allows you to:

  • Change the table name
  • Add custom columns
  • Modify indexes

Note: If you customize the table name, update the table value in your config file.

Optional: Publish Boost AI Helper

If your project uses Laravel Boost for AI-assisted workflows, publish the packaged .ai helper files so Boost can load the availability guidelines:

php artisan vendor:publish --tag=availability-ai

Note: Run php artisan boost:install after publishing the AI helper.

Re-run the command with the --force flag any time you want to refresh the helper files after updating the package.

Verify Installation

Test that everything is working:

use RomegaSoftware\Availability\Support\AvailabilityEngine;

$engine = app(AvailabilityEngine::class);
dd($engine); // Should return the engine instance

Next Steps

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