belongsTo('App\BlogCategory','blog_categories_id'); } public function user(){ return $this->belongsTo('App\Admin','user_id'); } protected $casts = [ 'breaking_news' => 'integer', 'user_id' => 'integer' ]; public function toFeedItem() : FeedItem { return FeedItem::create([ 'id' => $this->id, 'title' => $this->title, 'summary' => $this->excerpt, 'updated' => $this->updated_at, 'link' => route('frontend.blog.single',$this->slug), 'author' => $this->author, ]); } public static function getAllFeedItems() { return Blog::all(); } }