• 用户授权


    友情提示:新建的用于登录认证的模型类需要继承 IlluminateFoundationAuthUser 基类,不然后面就会出现不能认证的窘况。

     1 <?php
     2 
     3 namespace AppModels;
     4 
     5 use IlluminateContractsAuthMustVerifyEmail;
     6 use IlluminateDatabaseEloquentFactoriesHasFactory;
     7 use IlluminateFoundationAuthUser as Authenticatable;
     8 use IlluminateNotificationsNotifiable;
     9 
    10 class User extends Authenticatable
    11 {
    12     use HasFactory, Notifiable;
    13 
    14     /**
    15      * The attributes that are mass assignable.
    16      *
    17      * @var array
    18      */
    19     protected $fillable = [
    20         'name',
    21         'email',
    22         'password',
    23     ];
    24 
    25     /**
    26      * The attributes that should be hidden for arrays.
    27      *
    28      * @var array
    29      */
    30     protected $hidden = [
    31         'password',
    32         'remember_token',
    33     ];
    34 
    35     /**
    36      * The attributes that should be cast to native types.
    37      *
    38      * @var array
    39      */
    40     protected $casts = [
    41         'email_verified_at' => 'datetime',
    42     ];
    43 }
  • 相关阅读:
    struct&Method
    SetFinalizer、runtime.GC
    Map(没有写底层)
    数组和切片
    函数
    指针、Time
    字符串、strings、strconv
    基本类型和运算符
    第二阶段的事后诸葛亮
    第二个冲刺阶段第10天
  • 原文地址:https://www.cnblogs.com/gaogaoxingxing/p/15128171.html
Copyright © 2020-2023  润新知