argument('username'))->first(); if ($user === null) { $this->error('No user with such username'); return 1; } if ($user->is_admin) { $this->info('@' . $user->name . ' is already an administrator.'); return 0; } $user->is_admin = true; if ($user->save()) { $this->info('@' . $user->name . ' is an administrator now.'); } else { $this->error('Something happened.'); } } }