Files
mmc_info/app/Models/AUK.php
Александр Бабкин 97bacd4423 Continue MMC
2022-07-14 11:01:44 +03:00

34 lines
631 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class AUK extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'auks';
protected $fillable = [
'project_id',
'auk_name',
'auk_path',
'image_dir',
'parent_id',
];
public function childs()
{
return $this->hasMany('App\Models\AUK','parent_id','id');
}
public function mmcs()
{
return $this->belongsToMany(MMC::class,'auk_mmc','auk_id','mmc_id');
}
}