This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
vbbs/app/User.php

43 lines
795 B
PHP
Raw Permalink Normal View History

<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Models\CUG;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password',
];
public function cugs()
{
return $this->belongsToMany(Models\CUG::class,'cug_users','user_id','cug_id');
}
public function isMemberCUG(CUG $o)
{
// @todo This doesnt include parent CUGs
return $this->cugs->contains($o);
}
}