mirror of
https://github.com/koel/koel
synced 2024-11-12 23:47:09 +00:00
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use Illuminate\Auth\Authenticatable;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Illuminate\Auth\Passwords\CanResetPassword;
|
||
|
use Illuminate\Foundation\Auth\Access\Authorizable;
|
||
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||
|
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
|
||
|
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
||
|
|
||
|
class User extends Model implements AuthenticatableContract,
|
||
|
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 = [
|
||
|
'is_admin' => 'bool',
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* The attributes excluded from the model's JSON form.
|
||
|
*
|
||
|
* @var array
|
||
|
*/
|
||
|
protected $hidden = ['password', 'remember_token', 'created_at', 'updated_at' ];
|
||
|
|
||
|
public function playlists()
|
||
|
{
|
||
|
return $this->hasMany(Playlist::class);
|
||
|
}
|
||
|
|
||
|
public function interactions()
|
||
|
{
|
||
|
return $this->hasMany(Interaction::class);
|
||
|
}
|
||
|
}
|