Hassan Tariq
Hassan Tariq

Reputation: 59

Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found

I have downgrade my Laravel project from Laravel 8 to Laravel 7 because of some dependency . Now i am including "Vonage" for the video calling and my "guzzlehttp/guzzle" is on 7.0.1 . As Vonage API PHP SDK depends on version 6 of GuzzleHTTP but Laravel 8 uses version 7 . As the archititure of laravel 7 is diffrent from laravel 8 .I need to update GuzzleHTTP from my composer and On updating my composer It shows this error:

Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found

this is because of architecture of Laravel 8. Is their any possible way that I can update my composer?

Also, this project is a large scale project so I can't re create this project on Laravel 7.

Upvotes: 1

Views: 12553

Answers (1)

Nico Haase
Nico Haase

Reputation: 12102

The trait Illuminate\Database\Eloquent\Factories\HasFactory has been introduced in Laravel v8. It does not exist in Laravel v7, so you have to remove it from your code. The error message you have seen should show you more details about the file that uses the trait

Upvotes: 7

Related Questions