Wave Kit with custom builder for TomatoPHP Plugins
Caution
Use it on a fresh Laravel 12 project and if you have a database take a backup before use this package.
composer require tomatophp/filament-wave
after install you need to add HasRoles
to your User.php
model and add isAdmin()
fn like this
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
use HasRoles;
public function isAdmin(): bool
{
return true;
}
}
and on your routes/web.php
add this line and remove all other routes
\Wave\Facades\Wave::routes();
and on your config/auth.php
we need to add accounts
guard like this
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'accounts' => [
'driver' => 'session',
'provider' => 'accounts',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],
'accounts' => [
'driver' => 'eloquent',
'model' => App\Models\Account::class,
],
]
then you can run this command
php artisan config:cache
php artisan notifications:table
php artisan filament:install --panels
php artisan filament-wave:install
npm i
npm run build
php artisan optimize
if you are not using this package as a plugin please register the plugin on /app/Providers/Filament/AdminPanelProvider.php
->plugin(\Wave\FilamentWavePlugin::make())
now you need to optimize the views
php artisan optimize
if you like to run PEST
testing just use this command
composer test
if you like to fix the code style just use this command
composer format
if you like to check the code by PHPStan
just use this command
composer analyse
Checkout our Awesome TomatoPHP