18 lines
319 B
PHP
18 lines
319 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||
|
|
|
||
|
|
class Category extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = ['name', 'slug'];
|
||
|
|
|
||
|
|
|
||
|
|
public function projects(): BelongsToMany
|
||
|
|
{
|
||
|
|
return $this->belongsToMany(Project::class);
|
||
|
|
}
|
||
|
|
}
|