Class 'Form' not found in Laravel 7
Asked Answered
M

2

6

I'm upgrading from Laravel 5 to Laravel 7.

enter image description here

I'm using a lot of Form::model on my project.

Class 'Form' not found

I tried to install

"laravelcollective/html": "~5.0"

I kept getting

Problem 1
    - Conclusion: remove laravel/framework v7.3.0
    - Conclusion: don't install laravel/framework v7.3.0
    - Conclusion: don't install laravel/framework v7.2.2
    - Conclusion: don't install laravel/framework v7.2.1
    - Conclusion: don't install laravel/framework v7.2.0
    - Conclusion: don't install laravel/framework v7.1.3
    - Conclusion: don't install laravel/framework v7.1.2
    - Conclusion: don't install laravel/framework v7.1.1
    - Conclusion: don't install laravel/framework v7.1.0
    - Conclusion: don't install laravel/framework v7.0.8
    - Conclusion: don't install laravel/framework v7.0.7
    - Conclusion: don't install laravel/framework v7.0.6
    - Conclusion: don't install laravel/framework v7.0.5
    - Conclusion: don't install laravel/framework v7.0.4
    - Conclusion: don't install laravel/framework v7.0.3
    - Conclusion: don't install laravel/framework v7.0.2
    - Conclusion: don't install laravel/framework v7.0.1
    - Conclusion: don't install laravel/framework v7.0.0

What options do I have now ?

  1. replace all Form facade with HTML ? that would be a lot ... 😭
  2. add a Form Facade again on this new set up

Which one do you guys think I should do ?

Midshipman answered 29/3, 2020 at 23:14 Comment(2)
Have you tried with v6 laravelcollective? Check your version with: composer show -- laravelcollective/html – Repertory
use laravelcollective/html 6x instead of 5x. – Verbena
B
13

To support Laravel 7.x, you will need to install version 6.0 of the HTML package. 5.x Does not support newer versions of Laravel after 5.8. Update your composer.json.

"laravelcollective/html": "~6.0"

After that run.

composer install

Or simply require it from the command line.

composer require laravelcollective/html "~6.0"
Beltran answered 29/3, 2020 at 23:56 Comment(3)
Your updated answer works ! "laravelcollective/html": "~6.0" – Midshipman
Thanks @Beltran mrhn. For more information we can visit laravelcollective.com/docs/6.x/html – Bellows
BTW I am using it in Laravel 8.65 version. It works. – Bellows
R
20
composer require laravelcollective/html

this dependency removed from laravel

Raspings answered 30/3, 2020 at 0:9 Comment(1)
Yes dear, you are right. we will have to install it by composer composer require laravelcollective/html "~6.0" by command line. For more information we can visit laravelcollective.com/docs/6.x/html – Bellows
B
13

To support Laravel 7.x, you will need to install version 6.0 of the HTML package. 5.x Does not support newer versions of Laravel after 5.8. Update your composer.json.

"laravelcollective/html": "~6.0"

After that run.

composer install

Or simply require it from the command line.

composer require laravelcollective/html "~6.0"
Beltran answered 29/3, 2020 at 23:56 Comment(3)
Your updated answer works ! "laravelcollective/html": "~6.0" – Midshipman
Thanks @Beltran mrhn. For more information we can visit laravelcollective.com/docs/6.x/html – Bellows
BTW I am using it in Laravel 8.65 version. It works. – Bellows

© 2022 - 2024 β€” McMap. All rights reserved.