26 lines
530 B
PHP
26 lines
530 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Swindon\FilamentHashids\Traits\HasHashid;
|
|
|
|
class CategoryNews extends Model
|
|
{
|
|
use HasFactory, HasHashid;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public function category(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Category::class);
|
|
}
|
|
|
|
public function news(): BelongsTo
|
|
{
|
|
return $this->belongsTo(News::class);
|
|
}
|
|
}
|