FEATURE: add creating comments

This commit is contained in:
Michal Kváček
2016-09-05 12:50:04 +02:00
parent a33023a4aa
commit 9ce9f62a45
7 changed files with 192 additions and 26 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php namespace Modules\Blog\Article\Entities;
use App\Models\Content;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class Comment extends Model
{
protected $fillable = [
'user_id',
'content_id',
'content',
'email',
'name'
];
public function author()
{
return $this->belongsTo(User::class);
}
public function article()
{
return $this->belongsTo(Content::class);
}
}