2020-04-12 00:26:44 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
2023-02-05 23:35:08 +01:00
|
|
|
use App\Nami\HasNamiField;
|
2021-06-13 11:27:22 +02:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
2021-06-23 01:05:17 +02:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2022-02-17 02:36:29 +01:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2020-04-12 00:26:44 +02:00
|
|
|
|
|
|
|
class Group extends Model
|
|
|
|
{
|
2021-06-13 11:27:22 +02:00
|
|
|
use HasFactory;
|
2023-02-05 23:35:08 +01:00
|
|
|
use HasNamiField;
|
2021-06-13 11:27:22 +02:00
|
|
|
|
2022-02-17 02:36:29 +01:00
|
|
|
public $fillable = ['nami_id', 'name', 'parent_id'];
|
2020-04-12 00:26:44 +02:00
|
|
|
public $timestamps = false;
|
2021-06-24 23:48:08 +02:00
|
|
|
|
2022-02-17 02:36:29 +01:00
|
|
|
public function parent(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(static::class, 'parent_id');
|
|
|
|
}
|
2020-04-12 00:26:44 +02:00
|
|
|
}
|