<?php
namespace AppModels;
use IlluminateDatabaseEloquentModel;
class Post extends Model
{
/**
* Get the comments for the blog post.
*/
public function comments()
{
return $this->hasMany(Comment::class);
}
}
use AppModelsPost;
$comments = Post::find(1)->comments;
foreach ($comments as $comment) {
//
}
dd($staffFinalPayment->with('staff')->toArray());