Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5. use Illuminate\Database\Eloquent\Model;
  6.  
  7. class Event extends Model
  8. {
  9. protected $table = 'events';
  10.  
  11. // for confirmeds
  12. public function getConfirmedsAttributes()
  13. {
  14. $confirmeds = \DB::table('confirmados')->where('id_evento', $this->attributes['id'])->get();
  15. return $confirmeds->count();
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement