CourseWork/app/Models/Admin.php

18 lines
336 B
PHP
Raw Normal View History

2024-04-17 11:16:08 +04:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
2024-04-17 13:02:44 +04:00
use Illuminate\Database\Eloquent\Relations\MorphOne;
2024-04-17 11:16:08 +04:00
class Admin extends Model
{
use HasFactory;
2024-04-17 13:02:44 +04:00
public function user(): MorphOne
{
return $this->morphOne(User::class, 'userable');
}
2024-04-17 11:16:08 +04:00
}