12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Illuminate\Foundation\Auth\User as Authuser;
- use Illuminate\Notifications\Notifiable;
- use Tymon\JWTAuth\Contracts\JWTSubject;
- use Illuminate\Foundation\Auth\User as Authenticatable;
- use Illuminate\Auth\MustVerifyEmail as MustVerifyEmailTrait;
- use Illuminate\Contracts\Auth\MustVerifyEmail as MustVerifyEmailContract;
- use Illuminate\Support\Facades\Auth;
- class User extends Authenticatable implements MustVerifyEmailContract, JWTSubject
- {
- use SoftDeletes;
- protected $connection = 'mysql';
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- // use SoftDeletes;
- protected $fillable = [
- 'nickname','avatar','openid','unionid','tag','status','sex','mobile','auth_code','mobile_code'
- ];
- /**
- * The attributes that should be hidden for arrays.
- *
- * @var array
- */
- protected $hidden = [
- 'password'
- ];
- /**
- * Get the identifier that will be stored in the subject claim of the JWT.
- *
- * @return mixed
- */
- public function getJWTIdentifier()
- {
- return $this->getKey();
- }
- /**
- * Return a key value array, containing any custom claims to be added to the JWT.
- *
- * @return array
- */
- public function getJWTCustomClaims()
- {
- return [];
- }
- /*
- * 用户信息
- * */
- public function user_info()
- {
- return $this->belongsTo(User::class,'user_id');
- }
- }
|