08 2024
This commit is contained in:
parent
04d677d37a
commit
bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions
63
app/Models/DcTag.php
Normal file
63
app/Models/DcTag.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
|
||||
|
||||
/**
|
||||
* Class DcTag
|
||||
*
|
||||
* @property int $id
|
||||
* @property int|null $category_id
|
||||
* @property string $name
|
||||
* @property int $pos
|
||||
* @property string $slug
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property Collection|DcFileTag[] $dc_file_tags
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class DcTag extends Model
|
||||
{
|
||||
use Sluggable;
|
||||
|
||||
protected $table = 'dc_tags';
|
||||
|
||||
protected $casts = [
|
||||
'category_id' => 'int',
|
||||
'pos' => 'int',
|
||||
'active' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'category_id',
|
||||
'name',
|
||||
'pos',
|
||||
'slug',
|
||||
'active'
|
||||
];
|
||||
|
||||
public function sluggable()
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function dc_file_tags()
|
||||
{
|
||||
return $this->hasMany(DcFileTag::class, 'tag_id');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue