User controller

This commit is contained in:
Tony Murray
2020-06-19 00:17:18 -05:00
parent fbf0afffad
commit 15cd2311cc
2 changed files with 8 additions and 4 deletions

View File

@@ -39,11 +39,11 @@ class MakeUserController extends InstallationController implements InstallerStep
}
if (session('install.database')) {
$user = User::first();
$user = User::adminOnly()->first();
}
if (isset($user)) {
session(['install.user' => true]);
$this->markStepComplete('user');
return view('install.user-created', $this->formatData([
'user' => $user,
]));
@@ -76,12 +76,12 @@ class MakeUserController extends InstallationController implements InstallerStep
public function complete(): bool
{
return false;
return User::adminOnly()->exists();
}
public function enabled(): bool
{
return (bool)session('install.migrate');
return (bool)session('install.database');
}
public function icon(): string

View File

@@ -137,6 +137,10 @@ class User extends Authenticatable
});
}
public function scopeAdminOnly($query) {
$query->where('level', 10);
}
// ---- Accessors/Mutators ----
public function setRealnameAttribute($realname)