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
LeandroFerreira6mo ago
Add ^3.0 in the composer.json Filament and livewire Laravel should also be ^10 minimum-stability: "stable"
awcodes
awcodes6mo ago
Also, you’re not importing the MaxWidth class.
gon.exe
gon.exe6mo 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.exe6mo 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
Matthew6mo 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.exe6mo ago
I am running php 8.1 . I did your suggestion and could not import the needed class.
awcodes
awcodes6mo ago
Your filament version of 3.0.0 is not correct. Please share your composer.json.
bhlsunshine
bhlsunshine6mo ago
"filament/filament": "3.1-stable"
awcodes
awcodes6mo ago
Should be “^3.0” or “^3.1”
gon.exe
gon.exe6mo ago
I just changed to "filament/filament": "^3.0", then run "composer update" and the issue persists
LeandroFerreira
LeandroFerreira6mo ago
->maxContentWidth(\Filament\Support\Enums\MaxWidth::Full)
->maxContentWidth(\Filament\Support\Enums\MaxWidth::Full)
gon.exe
gon.exe6mo ago
No, I get the error "Class "Filament\Support\Enums\MaxWidth" not found"
awcodes
awcodes6mo ago
Delete the vendor directory and try a clean composer install.
gon.exe
gon.exe6mo ago
I have already tested it. It doesn't work either
gon.exe
gon.exe6mo ago
No description
LeandroFerreira
LeandroFerreira6mo ago
php artisan about what is the output?
gon.exe
gon.exe6mo 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
LeandroFerreira6mo ago
delete the composer.lock, the vendor folder and run again composer install
gon.exe
gon.exe6mo ago
😦 The same. I still getting the error
awcodes
awcodes6mo ago
please share your full composer.json in a gist. you're locked to v3.0.0 for some reason.
gon.exe
gon.exe6mo ago
Gist
composer.json
composer.json. GitHub Gist: instantly share code, notes, and snippets.
Solution
awcodes
awcodes6mo ago
remove "filament/forms": "3.0",
awcodes
awcodes6mo ago
it's included with filament/filament.
gon.exe
gon.exe6mo ago
Yes sir! It is working now! Thank you so much for your support! @awcodes and @Leandro Ferreira
Want results from more Discord servers?
Add your server
More Posts