mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
42 lines
924 B
PHP
42 lines
924 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Database\Factories\UserRoleFactory;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* UserRole Model
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property string $short_name
|
|
* @property string $description
|
|
* @property string $color_class
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
* @property-read Collection<int, User> $users
|
|
*/
|
|
class UserRole extends Model
|
|
{
|
|
/** @use HasFactory<UserRoleFactory> */
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The relationship between a user role and users.
|
|
*
|
|
* @return HasMany<User, $this>
|
|
*/
|
|
public function users(): HasMany
|
|
{
|
|
return $this->hasMany(User::class)
|
|
->chaperone();
|
|
}
|
|
}
|