To solve this issue I have created a custom page from filament.
php artisan make:filament-page SortUsers --resource=UserResource --type=custom
This command creates two files, one is a class file and the second is a view file. In the class file, I fetched the data with the help of the getViewData()
function from the stripe and returned that data to the view file. And in the view file, I have shown that data in a tabular format.
Steps:-
Run this command:-
php artisan make:filament-page SortUsers --resource=UserResource --type=custom
<?php
namespace App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource;
use Filament\Resources\Pages\Page;
class SortUsers extends Page
{
protected static string $resource = UserResource::class;
protected static string $view = 'filament.resources.user-resource.pages.sort-users';
public function getViewData(): array{
return $data;
}
}
Do a logical code in the getViewData
function and return data to the view file.
In the sort-users.blade.php
get the output of the array and print the data
<x-filament::page>
{{ $data }}
</x-filament::page>