I followed this documentation and I keep getting that main(): Failed opening required 'vendorautoload.php'
error and I ran composer install
but still get the same error. I’m using Laravel and I’m calling this from a Controller..
JavaScript
x
namespace AppHttpControllers;
require 'vendor/autoload.php';
use AppHttpControllersController;
use IlluminateHttpRequest;
use GoogleCloudSpeechSpeechClient;
use GoogleCloudSpeechStorageClient;
use AppModelFilesModel;
use IlluminateSupportFacadesDB;
class FilesController extends Controller
{
private $project_id;
private $speech;
private $options;
private $storage;
public function __construct()
{
$storage = new StorageClient([
'keyFile' => json_decode(file_get_contents(public_path() . '/key.json'), true)
]);
.
How do I bypass this issue?
Advertisement
Answer
first of all no need to do that! because it’s included in all pages…
if you insist doing this I think the problem is the address of autoload file which have to be:
JavaScript
require '../vendor/autoload.php';