F
Filament13mo ago
gon.exe

v3 Upgrade. MaxWidth not found

Hi everyone! I am updating my app. I have solved a lot of things so far, but I could not find a solution for the error "Class "App\Providers\Filament\MaxWidth" not found" when I want to use "->maxContentWidth(MaxWidth::Full)" on my AdminPanelProvider.php . I attach my app information: Environment Application Name . Green Ambiental
Laravel Version . 10.0.0 PHP Version . 8.1.0 Composer Version . 2.6.6 Environment . local Debug Mode . ENABLED URL . 127.0.0.1:8000 Maintenance Mode . OFF Cache Config . NOT CACHED Events . NOT CACHED
Routes . NOT CACHED Views . NOT CACHED Drivers Broadcasting . log Cache . file Database . pgsql Logs . stack / single Mail . smtp Queue . sync Session . file Filament Packages . filament, forms, notifications, support, tables Version . v3.0.0
Views . NOT PUBLISHED Livewire Livewire . v3.0.0 Thanks in advance!
Solution:
remove "filament/forms": "3.0",
Jump to solution
25 Replies
LeandroFerreira
LeandroFerreira13mo ago
Add ^3.0 in the composer.json Filament and livewire Laravel should also be ^10 minimum-stability: "stable"
awcodes
awcodes13mo ago
Also, you’re not importing the MaxWidth class.
gon.exe
gon.exeOP13mo ago
I did your suggestions and still not working. I could not import the class because is not present on vendor\filament\support\src\Enums
gon.exe
gon.exeOP13mo ago
Environment Application Name .. Green Ambiental
Laravel Version .. 10.37.3
PHP Version .. 8.1.0
Composer Version .. 2.6.6
Environment .. local
Debug Mode .. ENABLED
URL .. 127.0.0.1:8000
Maintenance Mode .. OFF
Cache Config .. NOT CACHED
Events .. NOT CACHED
Routes .. NOT CACHED
Views ... NOT CACHED
Drivers Broadcasting ... log Cache ... file Database ... pgsql Logs .. stack / single Mail ... smtp Queue ... sync Session ... file Filament Packages .. filament, forms, notifications, support, tables Version ... v3.0.0 Views .. NOT PUBLISHED Livewire Livewire ... v3.3.0
Matthew
Matthew13mo ago
1) You need php 8.1+. So make sure you do that first 2) Change filament/filament to "3.0-stable" Change the following dependencies
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
Try composer update
gon.exe
gon.exeOP13mo ago
I am running php 8.1 . I did your suggestion and could not import the needed class.
awcodes
awcodes13mo ago
Your filament version of 3.0.0 is not correct. Please share your composer.json.
bhlsunshine
bhlsunshine13mo ago
"filament/filament": "3.1-stable"
awcodes
awcodes13mo ago
Should be “^3.0” or “^3.1”
gon.exe
gon.exeOP13mo ago
I just changed to "filament/filament": "^3.0", then run "composer update" and the issue persists
LeandroFerreira
LeandroFerreira13mo ago
->maxContentWidth(\Filament\Support\Enums\MaxWidth::Full)
->maxContentWidth(\Filament\Support\Enums\MaxWidth::Full)
gon.exe
gon.exeOP13mo ago
No, I get the error "Class "Filament\Support\Enums\MaxWidth" not found"
awcodes
awcodes13mo ago
Delete the vendor directory and try a clean composer install.
gon.exe
gon.exeOP13mo ago
I have already tested it. It doesn't work either
gon.exe
gon.exeOP13mo ago
No description
LeandroFerreira
LeandroFerreira13mo ago
php artisan about what is the output?
gon.exe
gon.exeOP13mo ago
Environment Application Name . Green Ambiental
Laravel Version . 10.37.3
PHP Version . 8.1.0
Composer Version . 2.6.6
Environment . local
Debug Mode . ENABLED
URL . 127.0.0.1:8000
Maintenance Mode . OFF
Cache
Config . NOT CACHED
Events . NOT CACHED
Routes . NOT CACHED
Views . NOT CACHED
Drivers Broadcasting . log Cache . file Database . pgsql Logs . stack / single Mail . smtp Queue . sync Session . file
Filament Packages . filament, forms, notifications, support, tables Version . v3.0.0 Views . NOT PUBLISHED Livewire Livewire . v3.3.0
LeandroFerreira
LeandroFerreira13mo ago
delete the composer.lock, the vendor folder and run again composer install
gon.exe
gon.exeOP13mo ago
😦 The same. I still getting the error
awcodes
awcodes13mo ago
please share your full composer.json in a gist. you're locked to v3.0.0 for some reason.
gon.exe
gon.exeOP13mo ago
Gist
composer.json
composer.json. GitHub Gist: instantly share code, notes, and snippets.
Solution
awcodes
awcodes13mo ago
remove "filament/forms": "3.0",
awcodes
awcodes13mo ago
it's included with filament/filament.
gon.exe
gon.exeOP13mo ago
Yes sir! It is working now! Thank you so much for your support! @awcodes and @Leandro Ferreira

Did you find this page helpful?