Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyso authored and github-actions[bot] committed Oct 4, 2022
1 parent c011087 commit 6ca059e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions config/satset.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

return [
/*
|--------------------------------------------------------------------------
Expand All @@ -11,9 +12,9 @@
|
*/
'auth' => [
'model' => "App\\Models\\User"
'model' => 'App\\Models\\User',
],

'push_notification' => [
]
],
];
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public function getNotificationTokenParameterName()
*/
public function registerPushNotification()
{
if (!$this->shouldRegisterPushNotificationToken) {
if (! $this->shouldRegisterPushNotificationToken) {
return;
}

if (!method_exists($this->user(), 'pushNotificationToken')) {
if (! method_exists($this->user(), 'pushNotificationToken')) {
return;
}

if (!request()->filled($this->getNotificationTokenParameterName())) {
if (! request()->filled($this->getNotificationTokenParameterName())) {
return;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Http/Controllers/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function columnIdentifier(): array

public function columnIdentifierMap()
{
return collect($this->columnIdentifier())->mapWithKeys(fn($item, $key) => [$key => \request()->get($item)]);
return collect($this->columnIdentifier())->mapWithKeys(fn ($item, $key) => [$key => \request()->get($item)]);
}

/**
* Handle the incoming request.
*
* @param Request $request
* @param Request $request
* @return Response
*
* @throws ContainerExceptionInterface
Expand Down Expand Up @@ -106,15 +106,15 @@ protected function user(): Response|Model
});
}

if (!Hash::check(\request()->get('password'), @$user->password)) {
if (! Hash::check(\request()->get('password'), @$user->password)) {
return SSResponse::validationFailed(function (SSResponseMessageBag $errorBag) {
$errorBag->add(field: 'email', message: 'Email atau password tidak valid silahkan coba lagi');

return $errorBag;
});
}

if (!method_exists($user, 'createToken')) {
if (! method_exists($user, 'createToken')) {
throw new Exception("Your User model not use \"Laravel\Sanctum\HasApiTokens\" Traits");
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Features/Login/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use function Pest\Laravel\assertDatabaseHas;
use function Pest\Laravel\postJson;

function createUser($email = "[email protected]", $password = "password", ...$data): User
function createUser($email = '[email protected]', $password = 'password', ...$data): User
{
return User::create(
array_merge([
Expand Down Expand Up @@ -114,7 +114,7 @@ function registerRoute(?string $controller = null): void
[
'email' => '[email protected]',
'password' => 'password',
'notification_token' => '123456'
'notification_token' => '123456',
])
->assertOk();

Expand Down

0 comments on commit 6ca059e

Please sign in to comment.