| Install | |
|---|---|
composer require fuelviews/laravel-sabhero-estimator |
|
| Latest Version: | 0.0.15 |
| PHP: | ^8.3 |
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.
composer require fuelviews/laravel-sabhero-estimator
php artisan sabhero-estimator:install
This command will:
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
}
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(),
]);
}
Add the Livewire component to any Blade template:
@livewire('estimator::project-estimator')
Remove old migrations before installing:
php artisan sabhero-estimator:install --fresh
Overwrite existing files:
php artisan sabhero-estimator:install --force
For automated deployments:
php artisan sabhero-estimator:install --fresh --force --no-interaction
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"
The configuration file is published to config/sabhero-estimator.php:
'table' => [
'prefix' => 'estimator_', // Customize table prefix
],
'form_endpoints' => [
'production_url' => config('forms.forms.free_estimate.production_url'),
'development_url' => config('forms.forms.free_estimate.development_url'),
],
'media' => [
'disk' => 'public', // Use any Laravel filesystem disk (public, s3, etc.)
],
The package provides a complete multi-step estimation wizard:
Access these resources in your admin panel:
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');
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();
If images are showing duplicate paths:
php artisan migrate:fresh
php artisan vendor:publish --tag="sabhero-estimator-assets" --force
# Check migration status
php artisan migrate:status | grep estimator
# Clean reinstall
php artisan sabhero-estimator:install --fresh --force
# Verify tables exist
php artisan tinker --execute="DB::table('estimator_rates')->count()"
# If not found, reinstall
php artisan sabhero-estimator:install --fresh
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
Base Cost = Total Square Footage × Exterior Rate
Style/Floor/Condition = Applied additively
Coverage = Applied multiplicatively
Final Cost = ((Base Cost + Additive Multipliers) × Coverage)
Low Estimate = Final Cost × (1 - Deviation %)
High Estimate = Final Cost × (1 + Deviation %)
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 settingssrc/
├── 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
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.