Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ home/ jmdstrac/ public_html/ sabc/ app/ |
|
<?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'role_id', 'name', 'username', 'email', 'telephone', 'dateN', 'password', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; public function role() { return $this->belongsTo('App\Role'); } public function posts() { return $this->hasMany('App\Post'); } public function scopeAdmin($query){ return $query->where('role_id',1); } public function scopeAuthors($query){ return $query->where('role_id',2); } public function scopeClients($query){ return $query->where('role_id',3); } }