fuelviews / laravel-sabhero-estimator
A comprehensive painting project estimator package for Laravel applications with Livewire and FilamentPHP
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/fuelviews/laravel-sabhero-estimator
Requires
- php: ^8.3
- filament/filament: ^3.0
- illuminate/contracts: ^10.0||^11.0||^12.0
- illuminate/database: ^10.0||^11.0||^12.0
- illuminate/http: ^10.0||^11.0||^12.0
- illuminate/support: ^10.0||^11.0||^12.0
- illuminate/validation: ^10.0||^11.0||^12.0
- livewire/livewire: ^3.0
- ralphjsmit/laravel-glide: *
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0||^2.34
- pestphp/pest-plugin-arch: ^3.0||^2.7
- pestphp/pest-plugin-laravel: ^3.2||^2.3
- rector/rector: ^2.0
This package is auto-updated.
Last update: 2025-10-08 17:17:21 UTC
README
A comprehensive painting project estimator package for Laravel applications. This package provides a complete solution for collecting project details, calculating estimates, and managing painting project quotes with support for both interior and exterior projects.
Installation
1. Install via Composer
composer require fuelviews/laravel-sabhero-estimator
2. Run Installation Command
php artisan sabhero-estimator:install
This command will:
- Publish configuration file
- Publish and run migrations (including default data)
- Publish assets (house style images)
- Optionally publish views for customization
3. Configure Tailwind CSS
Add the package views to your tailwind.config.js
:
export default { content: [ // ... your existing paths './vendor/fuelviews/laravel-sabhero-estimator/resources/**/*.blade.php', ], // ... rest of your config }
4. Setup FilamentPHP Integration
Register the plugin in your FilamentPHP panel provider:
use Fuelviews\SabHeroEstimator\Filament\EstimatorPlugin; public function panel(Panel $panel): Panel { return $panel // ... other configuration ->plugins([ EstimatorPlugin::make(), ]); }
5. Add the Estimator Component
Add the Livewire component to any Blade template:
@livewire('estimator::project-estimator')
Installation Options
Clean Installation
Remove old migrations before installing:
php artisan sabhero-estimator:install --fresh
Force Overwrite
Overwrite existing files:
php artisan sabhero-estimator:install --force
Silent Installation
For automated deployments:
php artisan sabhero-estimator:install --fresh --force --no-interaction
Manual Installation
For complete control over the installation process:
# 1. Publish config php artisan vendor:publish --tag="sabhero-estimator-config" # 2. Publish migrations php artisan vendor:publish --tag="sabhero-estimator-migrations" # 3. Publish assets (images) php artisan vendor:publish --tag="sabhero-estimator-assets" # 4. Run migrations php artisan migrate # 5. (Optional) Publish views for customization php artisan vendor:publish --tag="sabhero-estimator-views"
Configuration
The configuration file is published to config/sabhero-estimator.php
:
Database Tables
'table' => [ 'prefix' => 'estimator_', // Customize table prefix ],
Form Endpoints
'form_endpoints' => [ 'production_url' => config('forms.forms.free_estimate.production_url'), 'development_url' => config('forms.forms.free_estimate.development_url'), ],
Media Storage
'media' => [ 'disk' => 'public', // Use any Laravel filesystem disk (public, s3, etc.) ],
Usage
Basic Implementation
The package provides a complete multi-step estimation wizard:
- Welcome - Introduction and project type selection
- Contact Info - Customer details collection
- Measurements - Project-specific measurements and options
- Review - Final estimate display and submission
FilamentPHP Admin Resources
Access these resources in your admin panel:
- Projects - View and manage submitted estimates
- Rates - Configure pricing for different surface types
- Multipliers - Manage house styles, floors, conditions, coverage
- Settings - Customize deviation percentages and labels
API Usage
use Fuelviews\SabHeroEstimator\SabHeroEstimator; $estimator = app(SabHeroEstimator::class); // Get surface types for a project $surfaces = $estimator->getSurfaceTypes('interior', 'partial'); // Get house styles with images $houseStyles = $estimator->getHouseStyles(); // Get configuration options $floorOptions = $estimator->getFloorOptions(); $paintConditions = $estimator->getPaintConditionOptions(); $coverageOptions = $estimator->getCoverageOptions(); // Manage settings $deviationPercentage = $estimator->getDeviationPercentage(); $estimator->setSetting('key', 'value'); // Work with images $imageUrl = $estimator->getImageUrl('pbg-ranch-1.jpg');
Model Usage
use Fuelviews\SabHeroEstimator\Models\Project; use Fuelviews\SabHeroEstimator\Models\Rate; use Fuelviews\SabHeroEstimator\Models\Multiplier; // Query projects $projects = Project::with(['areas.surfaces'])->latest()->get(); $interiorProjects = Project::where('project_type', 'interior')->get(); $premiumProjects = Project::where('estimated_high', '>', 5000)->get(); // Work with rates and multipliers $rates = Rate::where('project_type', 'interior')->get(); $houseStyles = Multiplier::houseStyle()->get();
Troubleshooting
Images Not Loading
If images are showing duplicate paths:
- Re-run migrations to fix image paths
- Ensure images are published to the correct location
- Check your media disk configuration
php artisan migrate:fresh
php artisan vendor:publish --tag="sabhero-estimator-assets" --force
Migration Issues
# Check migration status php artisan migrate:status | grep estimator # Clean reinstall php artisan sabhero-estimator:install --fresh --force
Table Not Found
# Verify tables exist php artisan tinker --execute="DB::table('estimator_rates')->count()" # If not found, reinstall php artisan sabhero-estimator:install --fresh
Advanced Topics
Calculation Logic
Interior Projects
Full Interior:
Base Cost = Total Square Footage × Interior Rate
Extras = Sum of selected extras (as multipliers)
Final Cost = Base Cost × (1 + Extras)
Partial Interior:
Cost = Sum of (Surface Area × Surface Rate) for each surface
Exterior Projects
Base Cost = Total Square Footage × Exterior Rate
Style/Floor/Condition = Applied additively
Coverage = Applied multiplicatively
Final Cost = ((Base Cost + Additive Multipliers) × Coverage)
Estimate Ranges
Low Estimate = Final Cost × (1 - Deviation %)
High Estimate = Final Cost × (1 + Deviation %)
Database Schema
The package creates these tables:
estimator_projects
- Main project recordsestimator_areas
- Project areas (partial interior)estimator_surfaces
- Surface details within areasestimator_rates
- Pricing rates with default dataestimator_multipliers
- Calculation multipliers with defaultsestimator_settings
- Configuration with default settings
Package Structure
src/
├── Commands/ # Installation commands
├── Contracts/ # Interface definitions
├── Filament/ # Admin panel resources
├── Livewire/ # Livewire components
├── Models/ # Eloquent models
└── Services/ # Business logic
database/
├── migrations/ # Schema migrations
└── factories/ # Model factories
resources/
├── views/ # Blade templates
└── images/ # House style images
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.