- replaced `alert-error` and `alert-success` components with a single reusable `alert` component - added JS functionality for dismissible alerts - updated related views to use the new `alert` component - adjusted broker profile logic to display initials and verification status dynamically - refactored morph relations from `type` to `role` - enhanced image preview behavior for file inputs - made broker migration fields nullable and added safeguards against registration errors - Added confirmation when a user wants delete deal - Add dynamic initials for user profile picture - make image file name non-overidding with timestamp
22 lines
373 B
PHP
22 lines
373 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
|
|
|
class Broker extends Model
|
|
{
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'verified' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function user(): MorphOne
|
|
{
|
|
return $this->morphOne(User::class, 'role');
|
|
}
|
|
}
|