-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
- PHP 8.4 or higher
- Laravel 12.0 or higher
- A configured database connection
Install the package using Composer:
composer require romegasoftware/availabilityThe service provider will auto-register with Laravel's package discovery.
Run the migrations to create the availability rules table:
php artisan migrateThis 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
If you need to customize the package configuration:
php artisan vendor:publish --tag=availability-configThis publishes the configuration file to config/availability.php.
If you need to customize the migration:
php artisan vendor:publish --tag=availability-migrationsThis allows you to:
- Change the table name
- Add custom columns
- Modify indexes
Note: If you customize the table name, update the
tablevalue in your config file.
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-aiNote: Run
php artisan boost:installafter 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.
Test that everything is working:
use RomegaSoftware\Availability\Support\AvailabilityEngine;
$engine = app(AvailabilityEngine::class);
dd($engine); // Should return the engine instance- Quick Start - Get your first availability rules working
- Configuration - Understand configuration options
- Basic Usage - Learn common patterns
Romega Software is software development agency specializing in helping customers integrate AI and custom software into their business, helping companies in growth mode better acquire, visualize, and utilize their data, and helping entrepreneurs bring their ideas to life.
Installation
Set up the package in your Laravel app
Quick Start
Get running in 5 minutes
Basic Usage
Common patterns and examples
How It Works
Understanding the evaluation engine
Rule Types
Available rule types and configurations
Priority System
How rule priority affects evaluation
Inventory Gates
Dynamic availability based on stock
Custom Evaluators
Build your own rule types
Complex Scenarios
Real-world implementation patterns
Performance Tips
Optimization strategies
Configuration
Package configuration options
Models & Traits
Available models and traits
Testing
Testing your availability rules