diff --git a/app/Console/Commands/DemoteUser.php b/app/Console/Commands/DemoteUser.php index 2d2081e..94dfe58 100644 --- a/app/Console/Commands/DemoteUser.php +++ b/app/Console/Commands/DemoteUser.php @@ -41,11 +41,13 @@ class DemoteUser extends Command $user = User::where('name', $this->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 user.'); + return 0; } diff --git a/app/Console/Commands/PromoteUser.php b/app/Console/Commands/PromoteUser.php index 8cfa452..b737ca5 100644 --- a/app/Console/Commands/PromoteUser.php +++ b/app/Console/Commands/PromoteUser.php @@ -41,11 +41,13 @@ class PromoteUser extends Command $user = User::where('name', $this->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; } diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index 2cda6de..b09d0c8 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers\Admin; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; +use Illuminate\Http\Request; class DashboardController extends Controller { diff --git a/app/Http/Controllers/Admin/InfoController.php b/app/Http/Controllers/Admin/InfoController.php index 744da19..37fde5b 100644 --- a/app/Http/Controllers/Admin/InfoController.php +++ b/app/Http/Controllers/Admin/InfoController.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers\Admin; +use App\Http\Controllers\Controller; use App\Information; use Illuminate\Http\Request; -use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Validator; use Illuminate\Validation\Rule; diff --git a/database/migrations/2019_02_11_140657_add_is_admin_to_users.php b/database/migrations/2019_02_11_140657_add_is_admin_to_users.php index b45ea47..2b37986 100644 --- a/database/migrations/2019_02_11_140657_add_is_admin_to_users.php +++ b/database/migrations/2019_02_11_140657_add_is_admin_to_users.php @@ -1,8 +1,8 @@