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.
Im trying to implement passport in lumen by using dusterio repo.
But when i do a migrate command (php artisan migrate), i got an error looks like :
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Laravel\Lumen\Application::post()
somebody could help, what's wrong here?
I've followed Laravel 5.3 upgrade guide, which says to add an unauthenticated method in App\Exceptions\Handler.
However, I get the following error when it gets called by the Auth system:
FatalThrowableError in Handler.php line 59:
Type error: Argument 2 passed to App\Exceptions\Handler::unauthenticated() must be an instance of App\Exceptions\AuthenticationException, instance of Illuminate\Auth\AuthenticationException given, called in /Users/Username/Development/ProjectName/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php on line 135
I've been searching for the last half hour and couldn't find a solution.
Any help?
Check how your Handler.php file compares to the 5.3 branch version here: https://github.com/laravel/laravel/blob/5.3/app/Exceptions/Handler.php
Note the unauthenticated() method in Handler.php expects an instance of \Illuminate\Auth\AuthenticationException. Make sure use Illuminate\Auth\AuthenticationException; is included at the top of the file.
In my case, i just deleted whoops... or restore the default Handler.php
I had this Error 500 inexplicable issue while upgrading from Laravel 5.2 to 5.3. No laravel error logs in storage/logs, no Apache error logs. no issue with .env, debug was turned on, no broken .htaccess directives, plus php artisan could not run. Tried everything until I looked in the PHP error logs and found:
PHP Fatal error: Uncaught Error: Undefined constant 'Illuminate\Auth\AuthenticationException' in C:\code\laravel-project\vendor\laravel\framework\src\Illuminate\Container\Container.php:79
So I did what #jon suggested and compared my Handler.php file with the fresh laravel one and found this:
In your App/Exceptions/Handler.php make sure that the classes in the $dontreport array are referenced as either strings in quotes:
'\Illuminate\Auth\AuthenticationException',
'\Illuminate\Auth\Access\AuthorizationException',
'\Symfony\Component\HttpKernel\Exception\HttpException',
'\Illuminate\Database\Eloquent\ModelNotFoundException',
'\Illuminate\Session\TokenMismatchException',
'\Illuminate\Validation\ValidationException',
or this way:
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
For some reason I found mine to not have the quotes and fixing that got rid of the Error 500.
I have an error while setting up the code
Call to undefined method Illuminate\Foundation\Application::bindShared()
The method bindShared does not exist anymore.
bindShared has been renamed to $app->singleton()
I have downloaded the very latest version of IonAuth for Codeigniter on GitHub. It is a very good library however when I try to logout after logging in I get the following error (which I've had in previous builds) - I know I can just comment the lines out but is there a reason for the errors?
Fatal error: Call to undefined method CI_Session::sess_destroy() ....\Ion_auth.php on line 381
I just kept them commented out.. seems to wrk