2017-11-03 05:26:07 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
2017-12-12 05:28:49 +00:00
|
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
2017-11-03 05:26:07 +00:00
|
|
|
|
2017-12-12 05:28:49 +00:00
|
|
|
class User extends Authenticatable
|
2017-11-03 05:26:07 +00:00
|
|
|
{
|
2017-12-12 05:28:49 +00:00
|
|
|
use Notifiable;
|
2017-11-03 05:26:07 +00:00
|
|
|
|
2017-12-12 05:28:49 +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
|
|
|
|
2017-12-12 05:28:49 +00:00
|
|
|
/**
|
|
|
|
* Only query active categories
|
|
|
|
*/
|
|
|
|
public function scopeActive()
|
|
|
|
{
|
|
|
|
return $this->where('active',TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getNameAttribute($value)
|
|
|
|
{
|
|
|
|
return $this->firstname.' '.$this->lastname;
|
|
|
|
}
|
|
|
|
}
|