Comment.php 323 B

1234567891011121314151617
  1. <?php
  2. class Comment extends Eloquent {
  3. protected $table = "comments";
  4. public function autor() {
  5. return $this->belongsTo('User', 'user');
  6. }
  7. public function objekt() {
  8. return $this->belongsTo('Film', 'film');
  9. }
  10. public function scopeNeueste($query) {
  11. return $query->orderBy('updated_at', 'DESC')->take(7);
  12. }
  13. }