當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。