Completed
Pull Request — master (#63)
by
unknown
02:50 queued 10s
created
database/migrations/2017_03_04_000000_create_bans_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('bans', function (Blueprint $table) {
27
+        Schema::create('bans', function(Blueprint $table) {
28 28
             $table->increments('id');
29 29
             $table->morphs('bannable');
30 30
             $table->nullableMorphs('created_by');
Please login to merge, or discard this patch.
src/Services/BanService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function unban(BannableContract $bannable): void
43 43
     {
44
-        $bannable->bans->each(function ($ban) {
44
+        $bannable->bans->each(function($ban) {
45 45
             $ban->delete();
46 46
         });
47 47
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             ->where('expired_at', '<=', Carbon::now()->format('Y-m-d H:i:s'))
58 58
             ->get();
59 59
 
60
-        $bans->each(function ($ban) {
60
+        $bans->each(function($ban) {
61 61
             $ban->delete();
62 62
         });
63 63
     }
Please login to merge, or discard this patch.
src/Scopes/BannedAtScope.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     protected function addWithBanned(Builder $builder): void
69 69
     {
70
-        $builder->macro('withBanned', function (Builder $builder) {
70
+        $builder->macro('withBanned', function(Builder $builder) {
71 71
             return $builder->withoutGlobalScope($this);
72 72
         });
73 73
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function addWithoutBanned(Builder $builder): void
82 82
     {
83
-        $builder->macro('withoutBanned', function (Builder $builder) {
83
+        $builder->macro('withoutBanned', function(Builder $builder) {
84 84
             return $builder->withoutGlobalScope($this)->whereNull('banned_at');
85 85
         });
86 86
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     protected function addOnlyBanned(Builder $builder): void
95 95
     {
96
-        $builder->macro('onlyBanned', function (Builder $builder) {
96
+        $builder->macro('onlyBanned', function(Builder $builder) {
97 97
             return $builder->withoutGlobalScope($this)->whereNotNull('banned_at');
98 98
         });
99 99
     }
Please login to merge, or discard this patch.
src/Http/Middleware/ForbidBannedUser.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
         $redirect_url = config('ban.redirect_url', false);
49 49
 
50 50
         if ($user && $user instanceof BannableContract && $user->isBanned()) {
51
-            if($redirect_url){
51
+            if ($redirect_url) {
52 52
                 return redirect($redirect_url)->withInput()->withErrors([
53 53
                     'login' => 'This account is blocked.',
54 54
                 ]);
55 55
             }
56
-            else{
56
+            else {
57 57
                 return redirect()->back()->withInput()->withErrors([
58 58
                     'login' => 'This account is blocked.',
59 59
                 ]);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
                 return redirect($redirect_url)->withInput()->withErrors([
53 53
                     'login' => 'This account is blocked.',
54 54
                 ]);
55
-            }
56
-            else{
55
+            } else{
57 56
                 return redirect()->back()->withInput()->withErrors([
58 57
                     'login' => 'This account is blocked.',
59 58
                 ]);
Please login to merge, or discard this patch.
src/Http/Middleware/LogsOutBannedUser.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@
 block discarded – undo
54 54
                 $this->auth->logout();
55 55
             }
56 56
             
57
-            if($redirect_url){
57
+            if ($redirect_url) {
58 58
                 return redirect($redirect_url)->withInput()->withErrors([
59 59
                     'login' => 'This account is blocked.',
60 60
                 ]);
61 61
             }
62
-            else{
62
+            else {
63 63
                 return redirect()->back()->withInput()->withErrors([
64 64
                     'login' => 'This account is blocked.',
65 65
                 ]);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
                 return redirect($redirect_url)->withInput()->withErrors([
53 53
                     'login' => 'This account is blocked.',
54 54
                 ]);
55
-            }
56
-            else{
55
+            } else{
57 56
                 return redirect()->back()->withInput()->withErrors([
58 57
                     'login' => 'This account is blocked.',
59 58
                 ]);
Please login to merge, or discard this patch.