Files
ficheagent/app/Models/Comment.php

23 lines
420 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Traits\BelongsToStructure;
class Comment extends Model
{
use BelongsToStructure;
protected $fillable = ['user_id', 'content', 'commentable_id', 'commentable_type'];
public function user()
{
return $this->belongsTo(User::class);
}
public function commentable()
{
return $this->morphTo();
}
}