本文整理汇总了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']);
}
示例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;
}