mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-07 04:59:36 +00:00
1. 继续修改表表关系,与关联字段的限制; 2. 通过表表关系,简化一部分代码,自动让Laravel建立关联; 3. 拆分验证 与 优化数据创建与修改的获取数据操作; 4. 修改部分无意义的数据名称;
22 lines
360 B
PHP
22 lines
360 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* 标签.
|
|
*/
|
|
class Label extends Model
|
|
{
|
|
public $timestamps = false;
|
|
protected $table = 'label';
|
|
protected $guarded = ['id'];
|
|
|
|
public function nodes()
|
|
{
|
|
return $this->belongsToMany(Node::class);
|
|
}
|
|
}
|