I have a laravel project and in it, I create a regular (.php
) file that I am posting some data to. In that file, I want to use a class that I installed using composer in the Laravel project. When I post data to the page I am getting the error No such file in directory
and require(): Failed opening required 'vendor/autoload.php
. How can I resolve this my project is almost complete if I can get this working.
I've tried: require "class name" but the same error.
PHP file posting to:
<?php
require "vendor/autoload.php";
require 'vendor\lcobucci\jwt\src\Builder.php';
require 'vendor\lcobucci\jwt\src\Signer.php';
//I've tried using these require statements
use \vendor\Lcobucci\JWT\Builder;
use \vendor\Lcobucci\JWT\Signer\Hmac\Sha256;
someFunctiion(){
// do stuff with function from class
}
?>
I expect that when I post to this page, the function from the class I am 'using' will be called but instead, it's saying require()
failed to open class.