摘要:
注:前提, 账号和密码的字段名一定要用 username和password 0、修改配置,修改config下的auth.php 将‘model’ 修改为 对应的 user模型 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' 阅读全文
posted @ 2020-07-20 17:23
养猪至富
阅读(484)
评论(0)
推荐(0)
摘要:
1、验证 public function login(Request $request) { $post = $this->validate($request, [ 'username' => 'required', 'password' => 'required', ], [ 'username. 阅读全文
posted @ 2020-07-20 16:25
养猪至富
阅读(1083)
评论(0)
推荐(0)
摘要:
1、创建填充文件 php artisan make:seeder UserSeeder 2、修改填充文件 /** *管理员 数据填充 */ public function run() { //清空数据表 User::truncate(); //添加模拟数据 100个用户 factory(User:: 阅读全文
posted @ 2020-07-20 15:11
养猪至富
阅读(275)
评论(0)
推荐(0)
摘要:
phpstorm2020 修改快捷注释时的斜杠的位置 用phpstorm给PHP代码设置//注释,默认情况下,快捷键 Ctrl + / 会将注释符 // 放在最前边, 可以通过以下设置使用//也跟代码一样支持缩进: File > Settings > Editor > Code Style > PH 阅读全文
posted @ 2020-07-20 14:51
养猪至富
阅读(503)
评论(0)
推荐(0)
摘要:
rbac 4表 常规设计 设计模型: 1、管理员表(users) Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('role_i 阅读全文
posted @ 2020-07-20 12:08
养猪至富
阅读(305)
评论(0)
推荐(0)
摘要:
laravel 模型迁移文件常规字段设计 # 迁移文件代码 Schema::create('表名', function (Blueprint $table) { // 主键 $table->bigIncrements('id'); $table->unsignedInteger('pid')->de 阅读全文
posted @ 2020-07-20 11:26
养猪至富
阅读(225)
评论(0)
推荐(0)
摘要:
php artisan 常用基础命令一 创建控制器 php artisan make:controller controller_name 创建中间件 php artisan make:middleware check 数据库相关操作 创建模型 php artisan make:model Mode 阅读全文
posted @ 2020-07-20 11:20
养猪至富
阅读(159)
评论(0)
推荐(0)

浙公网安备 33010602011771号