for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\Models;
use Xetaravel\Models\Article;
use Xetaravel\Models\User;
use Eloquence\Behaviours\CountCache\Countable;
class Comment extends Model
{
use Countable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'article_id',
'user_id',
'content'
];
* Return the count cache configuration.
* @return array
public function countCaches(): array
return [
User::class,
Article::class
}
* Get the user that owns the comment.
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
public function user()
return $this->belongsTo('Xetaravel\Models\User');
* Get the article that owns the comment.
public function article()
return $this->belongsTo('Xetaravel\Models\Article');