laravel5.8 Models
2024-10-07 04:46:37
<?php namespace App\Models; use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
//Authenticatable 继承
//vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.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',
// ];
}
最新文章
- AC自动机+DP HDOJ 2457 DNA repair(DNA修复)
- OpenCV2邻域和模板操作
- 调试技巧--Windows端口号是否被占用
- phpStorm连接mysql
- 图论(网络流):UVa 1659 - Help Little Laura
- 利用Azure backup备份和恢复Azure虚拟机(1)
- IOS开发-UI学习-使用UIImageView控件制作动画
- jenkins外网slave配置
- commanderJs编写命令行工具(cli)
- ML激活函数使用法则
- python 多文件知识
- JS实现用特殊符号替换字符串的中间部分区域
- 修改sga_max_size大小后重启数据库报 ORA-00851
- linux根文件系统制作,busybox启动流程分析
- sqlmap自动注入
- zabbix日常监控项mysql(七)
- P3758 [TJOI2017]可乐
- CSS 超出隐藏实现限制字数的功能代码(多浏览器支持)
- 009PHP文件处理——文件处理 file_get_contents file_put_contents fgetc fgets fgetss
- (接上一条)解决ssh隧道断开自动重连的问题