| 123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class Tag extends Model
- {
- use HasFactory;
- protected $fillable = [
- 'name',
- 'slug',
- ];
- protected $casts = [
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- ];
- // Связь многие-ко-многим: тег может быть у многих заявок
- public function submissions()
- {
- return $this->belongsToMany(Submission::class, 'submission_tag');
- }
- }
|