57 lines
1.7 KiB
PHP
57 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class PromotionLink
|
|
*
|
|
* @property int $id
|
|
* @property string $title
|
|
* @property string $link
|
|
* @property string $language
|
|
* @property int|null $show_on_homepage
|
|
* @property int|null $press_release_id
|
|
* @property Collection|Category[] $categories
|
|
* @package App\Models
|
|
* @property-read int|null $categories_count
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereLanguage($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereLink($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink wherePressReleaseId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereShowOnHomepage($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereTitle($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class PromotionLink extends Model
|
|
{
|
|
protected $table = 'promotion_link';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'show_on_homepage' => 'int',
|
|
'press_release_id' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'link',
|
|
'language',
|
|
'show_on_homepage',
|
|
'press_release_id'
|
|
];
|
|
|
|
public function categories()
|
|
{
|
|
return $this->belongsToMany(Category::class, 'promotion_link_category');
|
|
}
|
|
}
|