Changing color not working on service provider
Trying to set the base colors in AppServiceProvider.php:
<?php
namespace App\Providers;
use Filament\Support\Colors\Color;
use Filament\Support\Facades\FilamentColor;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
FilamentColor::register([
'danger' => Color::Red,
'gray' => Color::Zinc,
'info' => Color::Blue,
'primary' => Color::Amber,
'success' => Color::Green,
'warning' => Color::Amber,
]);
}
}
Im getting the image error. Am I missing something? Thanks for any help!!8 Replies
Are you on v2 or v3? You selected both. And you are using standalone table builder? No panel?
Where did you find that piece of code you are using?
I updated to v3, I got the code from here: https://filamentphp.com/docs/3.x/support/colors#customizing-the-default-colors and Im using just resources
And is there an error in the browser or only Intellephense complaning?
If it's not working: I think you need this for Panels:
https://filamentphp.com/docs/3.x/panels/themes#changing-the-colors
The erorrs is in both, navigating I get
Class "Filament\Support\Facades\FilamentColor" not found
It is like the library is not presentWhat's the version you are using?
artisan about
checking again im working on the v2 version. It is the artisan about:
Environment
Application Name Assets CF
Laravel Version ...... 9.52.14
PHP Version ............ 8.2.9
Composer Version ....... 2.5.8
Environment ............ local
Debug Mode .......... ENABLED
URL ... assets.cf.es
Maintenance Mode ......... OFF
Cache
Config ............ NOT CACHED
Events ............ NOT CACHED
Routes ............ NOT CACHED
Views ................. CACHED
Drivers
Broadcasting ............. log
Cache ................... file
Database ............... mysql
Logs .......... stack / single
Mail .................... smtp
Queue ................... sync
Session .................. file
Filament
Packages .................... filament, forms, notifications, support, tables
Version ............. v2.17.51
Views .......... NOT PUBLISHED
Thanks again for your help!!looks like you didn't actually upgrade. it's showing v2 not v3, and you won't be able to update to the latest v3 without updating to Laravel 10 first.