zoukankan      html  css  js  c++  java
  • laravel5.8 Models

    <?php

    namespace AppModels;

    use IlluminateNotificationsNotifiable;
    use IlluminateContractsAuthMustVerifyEmail;
    use IlluminateFoundationAuthUser as Authenticatable;
    //Authenticatable 继承
    //vendorlaravelframeworksrcIlluminateDatabaseEloquentBuilder.php 数据库的方法都继承了
    class User extends Authenticatable
    {
    use Notifiable;
    protected $table = "users";

    /**
    * The attributes that are mass assignable.
    *
    * @var array
    */
    protected $fillable = [
    'name', 'password',
    ];

    /**
    * The attributes that should be hidden for arrays.
    *
    * @var array
    */
    protected $hidden = [
    'password'
    ];
    public function setPasswordAttribute($value){
    $this->attributes['password'] = bcrypt($value);
    }
    /**
    * The attributes that should be cast to native types.
    *
    * @var array
    */
    // protected $casts = [
    // 'email_verified_at' => 'datetime',
    // ];
    }
  • 相关阅读:
    CSS伪元素
    leetcode
    软件镜像下载
    VUE项目问题
    js定时操作
    div 禁止点击
    JS String 与 Object 转换
    实用类
    XML文件的应用
    Socket编程
  • 原文地址:https://www.cnblogs.com/cbugs/p/11246277.html
Copyright © 2011-2022 走看看