You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
willaengine/app/Comment.php

26 lines
466 B

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use App\Appended\Traites\GetDateAttributesPersianTrait;
class Comment extends Model
{
use GetDateAttributesPersianTrait;
protected $fillable = ['text', 'user_id', 'commentable_id', 'commentable_type'];
public function user()
{
return $this->belongsTo('App\User')->select(['id','name']);
}
public function commentable()
{
return $this->morphTo();
}
}