Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User extends Eloquent {
- use SoftDeletes;
- protected $table = 'my_users';
- protected $fillable = array('first_name', 'last_name', 'email');
- protected $guarded = array('id', 'password'); // array('*');
- protected $dates = ['deleted_at'];
- protected function getDateFormat()
- {
- return 'U';
- }
- public function scopePopular($query)
- {
- return $query->where('votes', '>', 100);
- }
- public function phone()
- {
- return $this->hasOne('App\Phone');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement