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 5, 2022
1 parent 37f79f1 commit 4d642ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions src/Http/Controllers/Concerns/Login/Concerns/CanLoggedInUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getUserFromDatabase(): null|Builder|Model
}

/**
* @param Model|Builder|null $user
* @param Model|Builder|null $user
* @return void
*/
public function cacheUserIntoClassVariable(Model|Builder|null $user): void
Expand All @@ -35,7 +35,7 @@ public function cacheUserIntoClassVariable(Model|Builder|null $user): void
}

/**
* @param Model|Builder|null $user
* @param Model|Builder|null $user
* @return void
*/
public function triggerLoggedInEvent(Model|Builder|null $user): void
Expand All @@ -44,34 +44,36 @@ public function triggerLoggedInEvent(Model|Builder|null $user): void
}

/**
* @param Model|Builder|null $user
* @param Model|Builder|null $user
* @return void
*
* @throws Exception
*/
public function ensureUserHasImplementSanctumInModel(Model|Builder|null $user): void
{
if (!method_exists($user, 'createToken')) {
if (! method_exists($user, 'createToken')) {
throw new Exception("Your User model not use \"Laravel\Sanctum\HasApiTokens\" Traits");
}
}

/**
* @param Model|Builder|null $user
* @param Model|Builder|null $user
* @return void
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function ensureUserPasswordIsCorrect(Model|Builder|null $user): void
{
if (!Hash::check(\request()->get('password'), @$user->password)) {
if (! Hash::check(\request()->get('password'), @$user->password)) {
Response::validationFailed(function (\Illuminate\Support\MessageBag $errorBag) {
$errorBag->add('email', 'Email atau password tidak valid silahkan coba lagi');
});
}
}

/**
* @param Model|Builder|null $user
* @param Model|Builder|null $user
* @return void
*/
public function ensureUserIsExistInDatabase(Model|Builder|null $user): void
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ 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 \Illuminate\Http\Response
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Throwable
Expand Down

0 comments on commit 4d642ec

Please sign in to comment.