osb/app/User.php

32 lines
522 B
PHP
Raw Normal View History

2017-11-03 05:26:07 +00:00
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
2017-11-03 05:26:07 +00:00
class User extends Authenticatable
2017-11-03 05:26:07 +00:00
{
use Notifiable;
2017-11-03 05:26:07 +00:00
/**
* The country this user belongs to
*/
public function country()
{
return $this->belongsTo('App\Models\Country');
}
2017-11-03 05:26:07 +00:00
/**
* Only query active categories
*/
public function scopeActive()
{
return $this->where('active',TRUE);
}
public function getNameAttribute($value)
{
return $this->firstname.' '.$this->lastname;
}
}