当前位置: 首页>>代码示例>>PHP>>正文


PHP Setting::getList方法代码示例

本文整理汇总了PHP中app\Setting::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getList方法的具体用法?PHP Setting::getList怎么用?PHP Setting::getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Setting的用法示例。


在下文中一共展示了Setting::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     \DB::table('users')->delete();
     $settings = Setting::getList();
     $admin = User::create(['name' => 'root@root.test', 'email' => 'root@root.test', 'password' => \Hash::make('root@root.test'), 'memory_count' => $settings['memory_count'], 'reading_count' => $settings['reading_count'], 'repeat_term' => $settings['repeat_term'], 'lesson_size' => $settings['lesson_size']]);
     $admin->assignRole('admin');
     $user = User::create(['name' => 'user@user.test', 'email' => 'user@user.test', 'password' => \Hash::make('user@user.test'), 'memory_count' => $settings['memory_count'], 'reading_count' => $settings['reading_count'], 'repeat_term' => $settings['repeat_term'], 'lesson_size' => $settings['lesson_size']]);
     $user->assignRole('user');
     $user = User::create(['name' => 'Igor Demchenko', 'email' => 'demchenko.igor88@gmail.com', 'password' => \Hash::make('demchenko.igor88@gmail.com'), 'memory_count' => $settings['memory_count'], 'reading_count' => $settings['reading_count'], 'repeat_term' => $settings['repeat_term'], 'lesson_size' => $settings['lesson_size']]);
     $user->assignRole(['admin', 'user']);
 }
开发者ID:disik69,项目名称:backend.english-roulette-v0.3,代码行数:11,代码来源:UserTableSeeder.php

示例2: up

 public function up()
 {
     $validator = \Validator::make(\Request::all(), ['name' => 'required|max:100', 'email' => ['required', 'max:60', 'regex:/^.+@(\\w([\\w-]*\\w)?\\.)+\\w+$/', 'unique:users'], 'password' => 'required|min:6|max:100', 'captcha' => 'required|captcha']);
     if ($validator->passes()) {
         extract(\Request::all());
         $settings = Setting::getList();
         $user = User::create(['name' => $name, 'email' => $email, 'password' => \Hash::make($password), 'memory_count' => $settings['memory_count'], 'reading_count' => $settings['reading_count'], 'repeat_term' => $settings['repeat_term'], 'lesson_size' => $settings['lesson_size']]);
         $user->assignRole('user');
         $response = response()->json(['token' => \JWTAuth::fromUser($user)]);
     } else {
         $response = response()->json(['errors' => $validator->messages()->all()], 400);
     }
     return $response;
 }
开发者ID:disik69,项目名称:backend.english-roulette-v0.3,代码行数:14,代码来源:SignController.php


注:本文中的app\Setting::getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。