45 lines
921 B
PHP
45 lines
921 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Contracts\TranslatableModel;
|
|
use App\Traits\Models\HasTranslations;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Uwil\LaravelActivityLogs\Traits\ActivityLog;
|
|
|
|
class DocumentCategory extends Model implements TranslatableModel
|
|
{
|
|
use ActivityLog;
|
|
use HasFactory;
|
|
use HasTranslations;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var list<string>
|
|
*/
|
|
protected $fillable = [
|
|
'name',
|
|
];
|
|
|
|
/**
|
|
* The translatable columns.
|
|
*
|
|
* @var list<string>
|
|
*/
|
|
public $translatable = [
|
|
'name',
|
|
];
|
|
|
|
/**
|
|
* Relation to Document
|
|
*
|
|
* @return BelongsToMany
|
|
*/
|
|
public function documents(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(Document::class);
|
|
}
|
|
}
|