diff --git a/migrations/2018_06_25_000000_create_bans_table.php b/migrations/2018_06_25_000000_create_bans_table.php index 169fd9c..fd448aa 100644 --- a/migrations/2018_06_25_000000_create_bans_table.php +++ b/migrations/2018_06_25_000000_create_bans_table.php @@ -1,8 +1,8 @@ isBanned()) { return redirect()->back()->withInput()->withErrors([ - 'login' => 'This account is blocked.', - ]); + 'login' => 'This account is blocked.', + ]); } } catch (\BadMethodCallException $e) { throw new BannableTraitNotUsed($user); diff --git a/src/Models/Ban.php b/src/Models/Ban.php index 5edfcc0..c069307 100644 --- a/src/Models/Ban.php +++ b/src/Models/Ban.php @@ -3,8 +3,8 @@ namespace Qirolab\Laravel\Bannable\Models; use Carbon\Carbon; -use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Qirolab\Laravel\Bannable\Scopes\BannedModelScope; diff --git a/src/Observers/BanObserver.php b/src/Observers/BanObserver.php index 923aff9..be6098b 100644 --- a/src/Observers/BanObserver.php +++ b/src/Observers/BanObserver.php @@ -2,9 +2,9 @@ namespace Qirolab\Laravel\Bannable\Observers; -use Qirolab\Laravel\Bannable\Models\Ban; use Qirolab\Laravel\Bannable\Events\ModelWasBanned; use Qirolab\Laravel\Bannable\Events\ModelWasUnbanned; +use Qirolab\Laravel\Bannable\Models\Ban; class BanObserver { diff --git a/src/Scopes/BannedModelScope.php b/src/Scopes/BannedModelScope.php index 958f111..de888fd 100644 --- a/src/Scopes/BannedModelScope.php +++ b/src/Scopes/BannedModelScope.php @@ -2,9 +2,9 @@ namespace Qirolab\Laravel\Bannable\Scopes; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Scope; -use Illuminate\Database\Eloquent\Builder; class BannedModelScope implements Scope { diff --git a/tests/Stubs/Models/User.php b/tests/Stubs/Models/User.php index 6731585..f80c6da 100644 --- a/tests/Stubs/Models/User.php +++ b/tests/Stubs/Models/User.php @@ -2,8 +2,8 @@ namespace Qirolab\Tests\Laravel\Bannable\Stubs\Models; -use Qirolab\Laravel\Bannable\Traits\Bannable; use Illuminate\Foundation\Auth\User as Authenticatable; +use Qirolab\Laravel\Bannable\Traits\Bannable; class User extends Authenticatable { diff --git a/tests/TestCase.php b/tests/TestCase.php index cfe136f..23ba8b4 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -137,4 +137,4 @@ private function registerPackageFactories() $this->withFactories($pathToFactories); } -} \ No newline at end of file +} diff --git a/tests/Unit/BanExceptionTest.php b/tests/Unit/BanExceptionTest.php index 8e06e53..c6ee8ed 100644 --- a/tests/Unit/BanExceptionTest.php +++ b/tests/Unit/BanExceptionTest.php @@ -3,10 +3,10 @@ namespace Qirolab\Tests\Laravel\Bannable\Unit; use Illuminate\Http\Request; -use Qirolab\Tests\Laravel\Bannable\TestCase; -use Qirolab\Laravel\Bannable\Middleware\ForbidBannedUser; use Qirolab\Laravel\Bannable\Exceptions\BannableTraitNotUsed; +use Qirolab\Laravel\Bannable\Middleware\ForbidBannedUser; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\UserWithoutBannableTrait; +use Qirolab\Tests\Laravel\Bannable\TestCase; class BanExceptionTest extends TestCase { diff --git a/tests/Unit/BanMiddlewareTest.php b/tests/Unit/BanMiddlewareTest.php index 1ae42c1..4e0ac81 100644 --- a/tests/Unit/BanMiddlewareTest.php +++ b/tests/Unit/BanMiddlewareTest.php @@ -3,9 +3,9 @@ namespace Qirolab\Tests\Laravel\Bannable\Unit; use Illuminate\Http\Request; -use Qirolab\Tests\Laravel\Bannable\TestCase; -use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; use Qirolab\Laravel\Bannable\Middleware\ForbidBannedUser; +use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; +use Qirolab\Tests\Laravel\Bannable\TestCase; class BanMiddlewareTest extends TestCase { diff --git a/tests/Unit/BanModelTest.php b/tests/Unit/BanModelTest.php index 3b6ff35..b00d33f 100644 --- a/tests/Unit/BanModelTest.php +++ b/tests/Unit/BanModelTest.php @@ -4,8 +4,8 @@ use Carbon\Carbon; use Qirolab\Laravel\Bannable\Models\Ban; -use Qirolab\Tests\Laravel\Bannable\TestCase; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; +use Qirolab\Tests\Laravel\Bannable\TestCase; class BanModelTest extends TestCase { @@ -75,9 +75,9 @@ public function it_can_has_bannable_model() $user = factory(User::class)->create(); $ban = factory(Ban::class)->create([ - 'bannable_id' => $user->getKey(), - 'bannable_type' => $user->getMorphClass(), - ]); + 'bannable_id' => $user->getKey(), + 'bannable_type' => $user->getMorphClass(), + ]); $this->assertInstanceOf(User::class, $ban->bannable); } diff --git a/tests/Unit/BanObserverTest.php b/tests/Unit/BanObserverTest.php index 468402e..868f4b1 100644 --- a/tests/Unit/BanObserverTest.php +++ b/tests/Unit/BanObserverTest.php @@ -4,8 +4,8 @@ use Carbon\Carbon; use Qirolab\Laravel\Bannable\Models\Ban; -use Qirolab\Tests\Laravel\Bannable\TestCase; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; +use Qirolab\Tests\Laravel\Bannable\TestCase; class BanObserverTest extends TestCase { diff --git a/tests/Unit/BannableTest.php b/tests/Unit/BannableTest.php index 4bb7b2e..014ada2 100644 --- a/tests/Unit/BannableTest.php +++ b/tests/Unit/BannableTest.php @@ -4,8 +4,8 @@ use Carbon\Carbon; use Qirolab\Laravel\Bannable\Models\Ban; -use Qirolab\Tests\Laravel\Bannable\TestCase; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; +use Qirolab\Tests\Laravel\Bannable\TestCase; class BannableTest extends TestCase { @@ -78,12 +78,12 @@ public function model_can_unban() public function model_can_soft_delete_ban_on_unban() { $user = factory(User::class)->create([ - 'banned_at' => Carbon::now(), + 'banned_at' => Carbon::now(), ]); factory(Ban::class)->create([ - 'bannable_id' => $user->getKey(), - 'bannable_type' => $user->getMorphClass(), + 'bannable_id' => $user->getKey(), + 'bannable_type' => $user->getMorphClass(), ]); $this->assertCount(1, $user->bans); diff --git a/tests/Unit/BannedScopeTest.php b/tests/Unit/BannedScopeTest.php index 3a8d536..4a43354 100644 --- a/tests/Unit/BannedScopeTest.php +++ b/tests/Unit/BannedScopeTest.php @@ -3,9 +3,9 @@ namespace Qirolab\Tests\Laravel\Bannable\Unit; use Carbon\Carbon; -use Qirolab\Tests\Laravel\Bannable\TestCase; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\UserModelWithDisabledBannedScope; +use Qirolab\Tests\Laravel\Bannable\TestCase; class BannedScopeTest extends TestCase { @@ -61,12 +61,12 @@ public function it_can_get_models_with_banned() public function it_can_get_only_banned_models() { factory(User::class, 2)->create([ - 'banned_at' => Carbon::now()->subDay(), - ]); + 'banned_at' => Carbon::now()->subDay(), + ]); factory(User::class, 3)->create([ - 'banned_at' => null, - ]); + 'banned_at' => null, + ]); $entities = User::onlyBanned()->get(); diff --git a/tests/Unit/ModelBannedEventTest.php b/tests/Unit/ModelBannedEventTest.php index 54bf733..ab17c1a 100644 --- a/tests/Unit/ModelBannedEventTest.php +++ b/tests/Unit/ModelBannedEventTest.php @@ -2,9 +2,9 @@ namespace Qirolab\Tests\Laravel\Bannable\Unit; -use Qirolab\Tests\Laravel\Bannable\TestCase; use Qirolab\Laravel\Bannable\Events\ModelWasBanned; use Qirolab\Tests\Laravel\Bannable\Stubs\Models\User; +use Qirolab\Tests\Laravel\Bannable\TestCase; class ModelBannedEventTest extends TestCase { diff --git a/tests/Unit/ModelUnbannedEventTest.php b/tests/Unit/ModelUnbannedEventTest.php index ee263cb..9896d58 100644 --- a/tests/Unit/ModelUnbannedEventTest.php +++ b/tests/Unit/ModelUnbannedEventTest.php @@ -2,9 +2,9 @@ namespace Qirolab\Tests\Laravel\Bannable\Unit; +use Qirolab\Laravel\Bannable\Events\ModelWasUnbanned; use Qirolab\Laravel\Bannable\Models\Ban; use Qirolab\Tests\Laravel\Bannable\TestCase; -use Qirolab\Laravel\Bannable\Events\ModelWasUnbanned; class ModelUnbannedEventTest extends TestCase { diff --git a/tests/database/migrations/2018_06_25_000000__create_user_table.php b/tests/database/migrations/2018_06_25_000000__create_user_table.php index def7781..1f65166 100644 --- a/tests/database/migrations/2018_06_25_000000__create_user_table.php +++ b/tests/database/migrations/2018_06_25_000000__create_user_table.php @@ -1,8 +1,8 @@