schneespur/release/schneespur-1.0.2/app/Models/Customer.php
Michael 7288b93500 Release v1.0.2: diagnostic infrastructure core
Add neutral diagnostic framework for future reporting modules:
- DiagnosticReporterInterface, Registry, Manager, PayloadSanitizer
- Laravel exception hook in bootstrap/app.php
- Module permission declarations (requires_permissions in module.json)
- Core diagnostic report points (module boot/install/update failures)
- Module documentation update (moduldoku.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 16:54:11 +00:00

63 lines
1.5 KiB
PHP

<?php
namespace App\Models;
use Database\Factories\CustomerFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class Customer extends Authenticatable
{
/** @use HasFactory<CustomerFactory> */
use HasFactory, Notifiable;
protected $fillable = [
'name',
'contact_name',
'email',
'phone',
'auto_notify_email',
'notification_email',
'locale',
'password',
'portal_enabled',
'portal_show_gps',
'portal_show_photos',
'portal_show_driver_name',
];
protected $hidden = [
'password',
'remember_token',
];
protected function casts(): array
{
return [
'auto_notify_email' => 'boolean',
'password' => 'hashed',
'portal_enabled' => 'boolean',
'portal_show_gps' => 'boolean',
'portal_show_photos' => 'boolean',
'portal_show_driver_name' => 'boolean',
];
}
public function objects(): HasMany
{
return $this->hasMany(CustomerObject::class);
}
public function serviceJobs(): HasMany
{
return $this->hasMany(Job::class);
}
public function notificationLogs(): MorphMany
{
return $this->morphMany(NotificationLog::class, 'notifiable');
}
}