1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
|
4
|
|
|
namespace Sco\Admin\Models; |
5
|
|
|
|
6
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable; |
7
|
|
|
use Zizaco\Entrust\Traits\EntrustUserTrait; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Sco\Admin\Models\Manager |
11
|
|
|
* |
12
|
|
|
* @property int $id |
13
|
|
|
* @property string $name 名称 |
14
|
|
|
* @property string $email 邮箱 |
15
|
|
|
* @property string $password 密码 |
16
|
|
|
* @property string $remember_token |
17
|
|
|
* @property \Carbon\Carbon $created_at |
18
|
|
|
* @property \Carbon\Carbon $updated_at |
19
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Sco\Admin\Models\Role[] $roles |
20
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager whereCreatedAt($value) |
21
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager whereEmail($value) |
22
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager whereId($value) |
23
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager whereName($value) |
24
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager wherePassword($value) |
25
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager whereRememberToken($value) |
26
|
|
|
* @method static \Illuminate\Database\Query\Builder|\Sco\Admin\Models\Manager whereUpdatedAt($value) |
27
|
|
|
* @mixin \Eloquent |
28
|
|
|
*/ |
29
|
|
|
class Manager extends Authenticatable |
30
|
|
|
{ |
31
|
|
|
use EntrustUserTrait; |
32
|
|
|
|
33
|
|
|
protected $visible = ['id', 'name', 'email', 'created_at', 'roles']; |
34
|
|
|
|
35
|
|
|
protected $guarded = ['created_at', 'updated_at']; |
36
|
|
|
|
37
|
|
|
public function __construct(array $attributes = []) |
38
|
|
|
{ |
39
|
|
|
parent::__construct($attributes); |
40
|
|
|
|
41
|
|
|
$this->table = config('admin.manager_table'); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function setPasswordAttribute($value) |
45
|
|
|
{ |
46
|
|
|
$this->attributes['password'] = bcrypt($value); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|