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