2015-12-13 04:42:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Auth\Authenticatable;
|
|
|
|
use Illuminate\Auth\Passwords\CanResetPassword;
|
|
|
|
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
|
2015-12-14 13:22:39 +00:00
|
|
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
2015-12-13 04:42:28 +00:00
|
|
|
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
2015-12-14 13:22:39 +00:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Foundation\Auth\Access\Authorizable;
|
2015-12-13 04:42:28 +00:00
|
|
|
|
2015-12-14 13:22:39 +00:00
|
|
|
class User extends Model implements
|
|
|
|
AuthenticatableContract,
|
2015-12-13 04:42:28 +00:00
|
|
|
AuthorizableContract,
|
|
|
|
CanResetPasswordContract
|
|
|
|
{
|
|
|
|
use Authenticatable, Authorizable, CanResetPassword;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The database table used by the model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $table = 'users';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that are protected from mass assign.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
|
|
|
|
protected $casts = [
|
2015-12-15 10:32:41 +00:00
|
|
|
'id' => 'int',
|
2015-12-13 04:42:28 +00:00
|
|
|
'is_admin' => 'bool',
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes excluded from the model's JSON form.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2015-12-14 13:22:39 +00:00
|
|
|
protected $hidden = ['password', 'remember_token', 'created_at', 'updated_at'];
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
public function playlists()
|
|
|
|
{
|
|
|
|
return $this->hasMany(Playlist::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function interactions()
|
|
|
|
{
|
|
|
|
return $this->hasMany(Interaction::class);
|
|
|
|
}
|
|
|
|
}
|