34 lines
631 B
PHP
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');
|
|
}
|
|
|
|
}
|
|
|