File: D:/HostingSpaces/farmfun/reserveren.farmfun.be/app/Komma/Shop/Vat/Models/Rate.php
<?php
namespace App\Komma\Shop\Vat\Models;
use App\Komma\Kms\Core\Attributes\Models\Traits\HasThumbnailInterface;
use App\Komma\Kms\Core\Attributes\Models\Traits\HasThumbnailTrait;
use App\Komma\Kms\Core\Entities\DisplayNameInterface;
use App\Komma\Kms\Core\Entities\DisplayNameTrait;
use App\Komma\Sites\HasSitesInterface;
use App\Komma\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 bool $default
*/
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');
}
}