From 27fc5ee6e8263b6b32b2ebbe747e819c81d1cc3a Mon Sep 17 00:00:00 2001 From: shibafu Date: Thu, 14 Mar 2019 00:05:11 +0900 Subject: [PATCH] fix style --- app/Console/Commands/DemoteUser.php | 2 ++ app/Console/Commands/PromoteUser.php | 2 ++ app/Http/Controllers/Admin/DashboardController.php | 2 +- app/Http/Controllers/Admin/InfoController.php | 2 +- .../migrations/2019_02_11_140657_add_is_admin_to_users.php | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) 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 @@