ldc-mesbr-app/app/User.php
Vincent BRIDIER f0c322c843 - Add API v1
- Add PHPCS
2021-04-27 17:29:47 +02:00

65 lines
1.2 KiB
PHP

<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Notifications\ResetPassword;
class User extends Authenticatable
{
use Notifiable;
/**
* @var string
*/
const CREATED_AT = 'created_at';
/**
* @var string
*/
const UPDATED_AT = 'updated_at';
/**
* @var string
*/
protected $table = 'users';
/**
* @var string
*/
protected $primaryKey = 'id';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password', 'roles',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The sites that belong to the user.
*/
public function sites()
{
return $this->belongsToMany('App\Site', 'site_user', 'user_id', 'site_id');
}
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPassword($token));
}
}