Phase 8 and 9 marketplace matching

This commit is contained in:
Codex
2026-07-10 14:27:51 -05:00
parent 5009269907
commit 24f73084fa
21 changed files with 778 additions and 50 deletions
+15 -1
View File
@@ -4,13 +4,14 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Model;
#[Fillable([
'user_id', 'business_name', 'headline', 'bio', 'service_area', 'skills',
'services', 'tools', 'tool_inventory', 'certifications', 'certification_records',
'max_technician_level', 'services', 'tools', 'tool_inventory', 'certifications', 'certification_records',
'insurance_status', 'rate_card', 'travel_policy', 'availability_notes',
'website_url', 'phone', 'public_contact', 'profile_visibility', 'private_notes',
])]
@@ -24,6 +25,7 @@ class ProviderProfile extends Model
'certification_records' => 'array',
'profile_visibility' => 'array',
'public_contact' => 'boolean',
'max_technician_level' => 'integer',
];
}
@@ -47,6 +49,18 @@ class ProviderProfile extends Model
return $this->morphMany(Rating::class, 'rateable');
}
public function taxonomyTerms(): BelongsToMany
{
return $this->belongsToMany(TaxonomyTerm::class)
->withPivot('evidence_source')
->withTimestamps();
}
public function technicianLevel(): array
{
return config('technician-levels')[(int) $this->max_technician_level] ?? config('technician-levels')[1];
}
public function visible(string $field): bool
{
$visibility = $this->profile_visibility ?? [];