Ytake Laravel Aspect with Lumen 5.6 - php

I am using Lumen 5.6. When I run any commands or access any functions through Postman I got this error:
Class 'App\Providers\AnnotationConfiguration' not found
When I added this use Ytake\LaravelAspect\AnnotationConfiguration; in AspectServiceProvider.php, the above issue resolved but now I am getting this error.
Type error: Argument 1 passed to Ytake\LaravelAspect\AnnotationConfiguration::__construct() must be of the type array, null given, called in C:\Projects\cs415_api\app\Providers\AspectServiceProvider.php on line 22
I suspect that the following line in AspectServiceProvider returns null.
$app['config']->get('ytake-laravel-aop.annotation')
Any ideas on how to resolve this error?

This issue was resolved here:
https://github.com/ytake/Laravel-Aspect/issues/53

Related

PHP Fatal Error with Userfrosting now server always shows Error 500

I was managing my server and after a composer update I receive this message:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to UserFrosting\System\Facade::setFacadeContainer() must be an instance of Interop\Container\ContainerInterface, instance of Slim\Container given, called in /home/arteller/www/userfrosting/app/system/UserFrosting.php on line 53 and defined in /home/arteller/www/userfrosting/app/system/Facade.php:210
After this, I receive only 500 Internal Error from my server.
The error persists every time I also try to use the command "php bakery bake" or something related to bakery.
Anyone can help?
You need to update to UserFrosting 4.3.3 or later, and run composer update again. This issue was introduced by Slim, which introduced a breaking change recently.

Creating middleware throwing error

really new to laravel. Im using laravel 5.2. im trying to create a new middleware using "php artisan make:middleware MiddlewareName" but it gives me the following error :
Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of
Illuminate\Http\Request, null given, called in
C:\xampp\htdocs\dms\vendor\laravel\framework\src\Illuminate\Routing\RoutingServ
iceProvider.php on line 62 and defined in
C:\xampp\htdocs\dms\vendor\laravel\fra
mework\src\Illuminate\Routing\UrlGenerator.php on line 103
Can anyone please help. Thanks in advance.
This error is usually when you have routes outside the 'web' middleware. Kindly check your routes if you have any that is outside.

Laravel 5.3 unauthorized() AuthenticationException fatal error

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.

CodeIgniter Database Session Error

When I try to execute any controller of my CodeIgniter project i receive this error:
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in D:\Git\crud-farm\system\libraries\Session\drivers\Session_files_driver.php on line 49
A PHP Error was encountered
Severity: Error
Message: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read)
Filename: drivers/Session_files_driver.php
Line Number: 49
Backtrace:
I tried to replace CodeIgniter system files but it didn't work. The problem appears in all projects
Problem solved by restarting Apache.
I attach the url which saved me: http://forum.codeigniter.com/thread-64763.html
In my case i did the following
Restart apache
That's it!
The files in system should not be modified. My files were modified somehow and were throwing error. I resolved my problem as below.
Download fresh codeigniter and extract files
copy system files from fresh codeigniter into your project and overwrite the whole system folder.
This should fix your problem.

How to detect which file error in Lavel 5

I'm learing laravel 5. A day, when I run php artisan command I got this error
Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in C:\xampp\htdocs\premiumlens\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 62 and defined in C:\xampp\htdocs\premiumlens\vendor\laravel\framework\src\Illuminate\Routing\UrlGenerator.php on line 102
Almost application functions work perfect. But may not all. I'm sure the error is not caused by UrlGenerator.php
Now I cant use any artisan functions. How can I detect which file cause this issue.
Thank you !
I think you used url() helper in your config file, find where you put url() helper in your config file and remove it. your problem will be solved. i had this same problem and solved by removing url() form config file..
url('bassets/plugins/highcharts/highcharts.css'),

Categories