24 lines
432 B
PHP
24 lines
432 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
|
|
|
class Admin extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'last_name',
|
|
'middle_name',
|
|
];
|
|
|
|
public function user(): MorphOne
|
|
{
|
|
return $this->morphOne(User::class, 'userable');
|
|
}
|
|
}
|