1. Go to this page and download the library: Download qopiku/filament-sqids library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
qopiku / filament-sqids example snippets
use Qopiku\FilamentSqids\Traits\HasSqids;
class User extends Authenticatable
{
use HasSqids;
// ...
}
use Filament\Panel;
use Filament\PanelProvider;
use Qopiku\FilamentSqids\Plugin\SqidsPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->plugin(SqidsPlugin::make());
}
}
use Filament\Panel;
use Filament\PanelProvider;
use Qopiku\FilamentSqids\Middleware\FilamentSqidsMiddleware;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->middleware([
FilamentSqidsMiddleware::class, // Decodes Sqids for all routes in this panel
// ...existing code...
]);
}
}
use Filament\Resources\Resource;
class UserResource extends Resource
{
public static array|string $routeMiddleware = [
'filament-sqids', // Ensures Sqids are decoded for this resource's routes
];
}
bash
php artisan install:filament-sqids
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.