Remove the registration of the ApiTokens Livewire component, as it is no longer needed.
---
+++
@@ -8,13 +8,10 @@
use \App\Http\Livewire\DescendantChartComponent;
use App\Http\Livewire\PedigreeChart;
use App\Http\Livewire\PeopleSearch;
-use App\Http\Livewire\ApiTokens;
use App\Http\Livewire\CreateTeam;
use App\Http\Livewire\EditProfile;
use Filament\Facades\Filament;
use Illuminate\Database\Eloquent\Builder;
-
- // Add this line to import the Livewire component
class AppServiceProvider extends ServiceProvider
{
@@ -36,7 +33,6 @@
Livewire::component('descendant-chart-component', DescendantChartComponent::class);
Livewire::component('people-search', PeopleSearch::class);
Livewire::component('pedigree-chart', PedigreeChart::class);
- Livewire::component('api-tokens', ApiTokens::class);
Livewire::component('create-team', CreateTeam::class);
Livewire::component('edit-profile', EditProfile::class);
}
app/Filament/Pages/ApiTokensPage.php
Refactor the existing ApiTokensPage class to extend the Filament Page class and implement the necessary methods and properties. Update the class to work with Filament conventions.
---
+++
@@ -29,11 +29,13 @@
public function createApiToken(string $name, array $permissions): void
{
$this->user->createToken($name, $permissions);
+ $this->notify('success', 'API token created successfully.');
}
public function deleteApiToken(string $name): void
{
$this->user->tokens()->where('name', $name)->first()->delete();
+ $this->notify('success', 'API token deleted successfully.');
}
public function getHeading(): string
🚀 Here's the PR! #682
Actions
Step 1: 🔎 Searching
Here are the code search results. I'm now analyzing these search results to write the PR.
Relevant files (click to expand). Mentioned files will always appear here.
https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Http/Livewire/ApiTokens.php#L1-L18 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/resources/views/filament/pages/api-tokens.blade.php#L1-L2 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Providers/AppServiceProvider.php#L1-L42 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Providers/FilamentServiceProvider.php#L1-L28 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Providers/Filament/AdminPanelProvider.php#L1-L148 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Filament/Pages/ApiTokensPage.php#L1-L47 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Filament/Widgets/FanChartWidget.php#L1-L24 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Http/Livewire/CreateTeam.php#L1-L25 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/app/Http/Livewire/ProductsSection.php#L1-L12 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/resources/views/filament/pages/edit-profile.blade.php#L1-L34 https://github.com/liberu-genealogy/genealogy-laravel/blob/aa8385cd76ae6b5d487b8b8531f086f5a311913e/resources/views/filament/pages/edit-team.blade.php#L1-L10Step 2: ⌨️ Coding
app/Http/Livewire/ApiTokens.php
app/Providers/AppServiceProvider.php
app/Filament/Pages/ApiTokensPage.php
resources/views/filament/pages/api-tokens.blade.php
Step 3: 🔄️ Validating
Your changes have been successfully made to the branch
sweep/create_and_finish_livewire_component_for
. I have validated these changes using a syntax checker and a linter.This is an automated message generated by Sweep AI.