File: D:/HostingSpaces/SBogers10/csb.komma.pro/app/Vat/Models/Rate.php
<?php
namespace App\Vat\Models;
use Komma\KMS\Core\Attributes\Models\Traits\HasThumbnailInterface;
use Komma\KMS\Core\Attributes\Models\Traits\HasThumbnailTrait;
use Komma\KMS\Core\Entities\DisplayNameInterface;
use Komma\KMS\Core\Entities\DisplayNameTrait;
use Komma\KMS\Sites\HasSitesInterface;
use Komma\KMS\Sites\Models\Site;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Class Rate
*
* @property int $percentage
* @property string $description
* @property string $name
* @property boolean $default
*
* @package App\Vat\Models
*/
final class Rate extends Model implements DisplayNameInterface, HasThumbnailInterface, HasSitesInterface {
use DisplayNameTrait;
use HasThumbnailTrait;
protected $table = 'vatrates';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'description', 'percentage', 'default'];
/**
* Get the site or sites for this model
*
* @return BelongsToMany
*/
public function sites(): BelongsToMany
{
return $this->belongsToMany(Site::class, 'vatrate_site', 'vatrate_id');
}
}