mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 18:52:10 +00:00
26 lines
549 B
PHP
26 lines
549 B
PHP
<?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();
|
|
}
|
|
}
|