Skip to content

Commit

Permalink
Merge pull request #343 from ArtrenH/2.x
Browse files Browse the repository at this point in the history
Fix issue with token creation and expiry date
  • Loading branch information
jeffgreco13 authored Mar 2, 2024
2 parents e2bfcb1 + b28c704 commit cee88e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Livewire/SanctumTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Jeffgreco13\FilamentBreezy\Livewire;

use Carbon\Carbon;
use Filament\Facades\Filament;
use Filament\Forms;
use Filament\Notifications\Notification;
Expand Down Expand Up @@ -89,7 +90,7 @@ protected function getTableHeaderActions(): array
->modalWidth($this->modalWidth)
->form($this->getSanctumFormSchema())
->action(function ($data) {
$this->plainTextToken = $this->user->createToken($data['token_name'], array_values($data['abilities']))->plainTextToken;
$this->plainTextToken = $this->user->createToken($data['token_name'], array_values($data['abilities']), $data['expires_at'] ? Carbon::createFromFormat('Y-m-d', $data['expires_at']) : null)->plainTextToken;
Notification::make()
->success()
->title(__('filament-breezy::default.profile.sanctum.create.notify'))
Expand Down

0 comments on commit cee88e8

Please sign in to comment.