本文整理匯總了PHP中backend\models\User::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::all方法的具體用法?PHP User::all怎麽用?PHP User::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backend\models\User
的用法示例。
在下文中一共展示了User::all方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: up
public function up()
{
Schema::table('backend_users', function (Blueprint $table) {
$table->boolean('is_superuser')->default(false);
});
AdminModel::all()->each(function ($user) {
if ($user->hasPermission('superuser')) {
$user->is_superuser = true;
$user->save();
}
});
}
示例2: prepareVars
public function prepareVars()
{
$this->vars['name'] = $this->formField->getName();
$this->vars['value'] = $this->model->{$this->columnName};
$this->vars['myID'] = BackendAuth::getUser()->id;
$this->vars['users'] = User::all();
$project = new Projects();
if (isset($project->params[0])) {
$this->vars['projectAssign'] = Assign::where('project_id', '=', $project->params[0]);
}
$this->vars['getInfo'] = new User();
}
示例3: findAdminEmail
/**
* @return mixed
* @throws \ErrorException
*/
private function findAdminEmail()
{
$sendTo = false;
$users = User::all();
foreach ($users as $user) {
if ($user->isSuperUser()) {
$sendTo = $user->email;
break;
}
}
if ($sendTo === false) {
throw new \ErrorException('None email registered neither exists an admin user on the system (!?)');
}
return $sendTo;
}
示例4: getDefaultAuthorOptions
public function getDefaultAuthorOptions()
{
return AuthorModel::all()->lists('full_name', 'email');
}