News.php 249 B

1234567891011121314
  1. <?php
  2. class News extends Eloquent {
  3. protected $table = "news";
  4. public function ersteller() {
  5. return $this->belongsTo('User', 'author');
  6. }
  7. public function scopeAktuell($query) {
  8. return $query->orderBy('updated_at', 'DESC')->take(5);
  9. }
  10. }