Label.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\Relations\HasMany;
  5. /**
  6. * 标签.
  7. *
  8. * @property int $id
  9. * @property string $name 名称
  10. * @property int $sort 排序值
  11. * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Node[] $nodes
  12. * @property-read int|null $nodes_count
  13. * @method static \Illuminate\Database\Eloquent\Builder|Label newModelQuery()
  14. * @method static \Illuminate\Database\Eloquent\Builder|Label newQuery()
  15. * @method static \Illuminate\Database\Eloquent\Builder|Label query()
  16. * @method static \Illuminate\Database\Eloquent\Builder|Label whereId($value)
  17. * @method static \Illuminate\Database\Eloquent\Builder|Label whereName($value)
  18. * @method static \Illuminate\Database\Eloquent\Builder|Label whereSort($value)
  19. * @mixin \Eloquent
  20. */
  21. class Label extends Model
  22. {
  23. public $timestamps = false;
  24. protected $table = 'label';
  25. protected $guarded = [];
  26. public function nodes()
  27. {
  28. return $this->belongsToMany(Node::class);
  29. }
  30. }