File: D:/HostingSpaces/SBogers10/vangogh.komma.pro/app/Komma/Servicepoints/Models/Servicepoint.php
<?php
/**
*
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2016, Komma
*/
namespace App\Komma\Servicepoints\Models;
use App\Komma\Components\Component\ComponentableInterface;
use App\Komma\Components\Component\ComponentableTrait;
use App\Komma\Documents\DocumentsTrait;
use App\Komma\Documents\Kms\DocumentableInterface;
use App\Komma\Globalization\Languages\Models\Language;
use App\Komma\Kms\Core\AbstractTranslatableModel;
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\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* Class Servicepoint
*
* @package App\Komma\Servicepoints\Models
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Languages\Models\Language[] $languages
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Sites\Models\Site[] $sites
* @property-read \App\Komma\Servicepoints\Models\ServicepointTranslation $translation
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Servicepoints\Models\ServicepointTranslation[] $translations
* @mixin \Eloquent
* @property int $id
* @property int $active
* @property string $name
* @property \Carbon\Carbon|null $created_at
* @property \Carbon\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint whereUpdatedAt($value)
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Documents\Models\Document[] $documents
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Documents\Models\Document[] $images
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Servicepoints\Models\Servicepoint query()
*/
final class Servicepoint extends AbstractTranslatableModel implements DocumentableInterface, DisplayNameInterface
{
use DocumentsTrait;
use DisplayNameTrait;
protected $table = 'servicepoints';
protected $class = Servicepoint::class;
protected $fillable = ['active', 'name'];
/**
* Gets the translation models for this model
*
* @return HasMany that resolves to AbstractTranslationModel instances
*/
public function translations(): HasMany
{
return $this->hasMany(ServicepointTranslation::class);
}
public function languages(): BelongsToMany
{
return $this->belongsToMany(Language::class, 'servicepoint_translations')
->withPivot('slug', 'name', 'description')
->withTimestamps();
}
}