22 lines
417 B
PHP
22 lines
417 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
|
|
class CategoryNews extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
public function category(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(Category::class);
|
|
}
|
|
|
|
public function news(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(News::class);
|
|
}
|
|
}
|