Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. class User extends Eloquent {
  2.  
  3. use SoftDeletes;
  4. protected $table = 'my_users';
  5. protected $fillable = array('first_name', 'last_name', 'email');
  6. protected $guarded = array('id', 'password'); // array('*');
  7. protected $dates = ['deleted_at'];
  8.  
  9. protected function getDateFormat()
  10. {
  11. return 'U';
  12. }
  13.  
  14. public function scopePopular($query)
  15. {
  16. return $query->where('votes', '>', 100);
  17. }
  18.  
  19. public function phone()
  20. {
  21. return $this->hasOne('App\Phone');
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement