mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 18:32:09 +00:00
fix: refactored the codebase
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Settings;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Laravel\Passkeys\Passkey;
|
||||
|
||||
class SecuritySettingsService
|
||||
{
|
||||
/**
|
||||
* @return Collection<int, Passkey>
|
||||
*/
|
||||
public function passkeys(User $user, bool $enabled): Collection
|
||||
{
|
||||
if (! $enabled) {
|
||||
return new Collection;
|
||||
}
|
||||
|
||||
return $user->passkeys()
|
||||
->select(['id', 'user_id', 'name', 'credential', 'created_at', 'last_used_at'])
|
||||
->latest()
|
||||
->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user