blog/app/Models/Post.php
Niisse 3dae0c93fb Work on tidying up, blog page, pagination, and more
todo: in models for photos and posts, add belongsTo and hasMany respectively
2024-03-18 18:00:16 -07:00

26 lines
497 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Post extends Model
{
use HasFactory;
protected $fillable = [
'title',
'type',
'content',
'location',
];
public function tags(): BelongsToMany
{
return $this->belongsToMany(Tag::class);
}
}