Comment.php 360 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class Comment extends Model
  6. {
  7. use HasFactory;
  8. public function film() {
  9. return $this->belongsTo(Film::class, 'film');
  10. }
  11. public function author() {
  12. return $this->belongsTo(User::class, 'user');
  13. }
  14. }