dimanche 25 février 2018

include a class from a different website in laravel new project

I am working on a backend api using laravel 5.6 Already have a website with tons of code - all the answers I found point at create a new folder and adding my classes there that is not an option. I would like to include the class from the main site (same server) and use the methods within laravel to generate the data from the api.

 Route::get('api/author/full/', array('uses' => 'AuthorController@getAuthor'));

I am using this line to include my class:

require_once('/var/www/html/modules/author/models/Author.class.php');

laravel is located in a subfolder at /var/www/html/api/

this is the error I get when i try to require that file from within the AuthorController :

 Fatal error: Call to undefined method ErrorException::getStatusCode() in  /html/api/app/Exceptions/Handler.php on line 61

Fatal error: Call to undefined method Symfony\Component\Debug\Exception\FatalErrorException::getStatusCode() in  /html/api/app/Exceptions/Handler.php on line 61

really tried everything here,included it in public/index.php and in other places and none of these things worked.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire