Preview: Blog.php
Size: 572 B
/home/getspomw/royalsquad.us/app/Models/Blog.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Blog extends Model
{
use HasFactory;
/**
* The attributes that aren't mass assignable.
*
* @var array
*/
protected $guarded = ['id']; // Protect the 'id' field
/**
* Get the category that owns the blog.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function category()
{
return $this->belongsTo(BlogCategory::class, 'category_id');
}
}
Directory Contents
Dirs: 0 × Files: 9