本文整理匯總了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;
}