InfyOmLabs / laravel-generator

API and Admin Panel CRUD Generator for Laravel.
https://www.infyom.com/open-source
MIT License
3.79k stars 812 forks source link

Class 'InfyOm\Generator\Common\BaseRepository' not found #889

Closed Silviobramas closed 4 years ago

Silviobramas commented 4 years ago

after I updated laravel from 6.x to 7.0 I get the following error.

Class 'InfyOm\Generator\Common\BaseRepository' not found

That happens in all my repository files. in the repositoryfile is written "use InfyOm\Generator\Common\BaseRepository;" when I delete this line I get another error:

Symfony\Component\ErrorHandler\Error\FatalError Class App\Repositories\VersandartRepository contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (App\Repositories\BaseRepository::getFieldsSearchable)

Can you help me?

mitulgolakiya commented 4 years ago

@Silviobramas From Laravel 7, this has been published as a part of vendor publish. so you will be able to find a BaseRepository class into app/Repositories. so you should replace the use statement with that newly published BaseRepository.php path.

Silviobramas commented 4 years ago

yes I did it

use App\Repositories\BaseRepository;

but there is another problem then:

Symfony\Component\ErrorHandler\Error\FatalError Class App\Repositories\VersandartRepository contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (App\Repositories\BaseRepository::getFieldsSearchable)

mitulgolakiya commented 4 years ago

Then as the error says, you will need to implement the missing abstract methods. I will suggest you check the generation of Version 7 in separate fresh project and then upgrade the same way.

Silviobramas commented 4 years ago

i added public function getFieldsSearchable() { return $this->fieldSearchable; }

Than I have the next error: Call to undefined method App\Repositories\VersandartRepository::pushCriteria()

How can I update the "resources/infyom" folder? I can see that my templates are different to the github files. But the publish functions doesn't work.

Silviobramas commented 4 years ago

Ok it works now. You need to delete the ->pushCriteria line in each Controller