Comment.php 215 B

123456789101112131415
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Comment extends Model
  5. {
  6. //
  7. protected $fillable = ['text', 'post_id'];
  8. public function post(){
  9. return $this->belongsTo('App\Post');
  10. }
  11. }