After Renamimg app name getting FatalThrowableError - php

I am using laravel-5.3. After renaming the app when I'm trying to start the server I'm getting the following error
[Symfony\Component\Debug\Exception\FatalThrowableError] Class
'App\Providers\AppServiceProvider' not found
What should i do? I am new at Laravel.

This is probably because you have your configuration cached. You can solve it with the artisan command 'config:cache':
php artisan config:cache
Before this, make sure that you have the correct namespaces in your application.

Related

trying to run php artisan tinker returns error "file_exists(): Unable to find the wrapper "hoa" "

I'm trying to open tinker in a Laravel project, but when I run php artisan tinker I get this error:
ErrorException
file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP?
I can't find everything similar error online, I found only similar errors but with 'wrapper http' .
Does anyone have any suggestions? Thanks
Could this be due to custom code or a library you've imported?
I often find that if I add things to the ServiceProvider or Kernel, they run before many of the artisan commands, and if I've failed to perform the proper "if" checks first, it fails.
I suppose the question I would have in return would be; Is this a fresh Laravel install or have you got custom code and libraries running? I would check there, try removing libraries you've added, HOA from my searching doesn't appear to default to Laravel.
— Happy to revise my answer should more detail be provided
Solved with this command founded on github:
composer require psy/psysh:0.11.2 --dev

Why getting this error for Laravel JWT auth on heroku server

Getting this error when calling any api:
Argument 3 passed to Lcobucci\\JWT\\Signer\\Hmac::doVerify() must be an instance of Lcobucci\\JWT\\Signer\\Key, null given, called in /app/vendor/lcobucci/jwt/src/Signer/BaseSigner.php on line 44
I am using tymondesigns/jwt-auth with laravel for api authentication.
I tried running this php artisan optimize after generating jwt:secret
My laravel application is hosted on basic heroku server with pgsql
It's possible that you are getting this error when you uploaded the applications before implementing the JWT and re-uploaded directly without reuploading the .env file.
If this is the case, the simplest way to solve this adding the JWT key in your .env file :
Here an example:
JWT_SECRET=jghgvfuldMpw5i4039393939393372y98bEWumqd9ls7Uk8DEpr0gIhgftrf
Or create jwt key with the command :
php artisan jwt:secret
Don't forget to clear config after changing your environment :
php artisan config:clear
php artisan config:cache

laravel artisan app:name resulted in syntax errors

I am using Laravel 5 on a shared host. I have installed it ok. However on running:
/usr/bin/php55-cli artisan app:name 247
the laravel install broke. I tracked it down to app.php and the new name caused syntax errors. I got it working again by using Linux to do a global replace changing it back from 247 to App.
Does anyone know why? And how can I get artisan to work properly?
Thanks
This is not Laravel nor artisan issue, but plain PHP syntax error.
PHP does not allow variable or class name to start with an integer. Same goes to namespaces. So your error comes from you app name being 247. First letter can not be an integer.

Php artisan not working (laravel 5.1)

Suddenly when i type php artisan or any artisan command
i seen this message
[ErrorException]
Trying to get property of non-object
I tried the following
1- php artisan clear-compiled
2- To delete vendor directory and use composer install Or composer update
3- clone a standard Laravel app and put my files app dir and my config
and use composer commands but with step the error has changed to be
[ErrorException]
Trying to get property of non-object
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output:
Any Suggestions ?
Thanks
If I understand well, you have this issue when you use your app files. It probably means that you have some problem in constructor - you try to run function and the object is not initialized. You should not set up things in constructors (look for example at your controllers) or you will get some "strange" errors and your artisan won't work
After navigation on my app i found the issue in my ServiceProviderClass boot() method in particular when comment one method get data according to subDomain name artisan worked well
Laravel Doc hint for this method
This method is called after all other service providers have been registered, meaning you have access to all other services that have been registered by the framework
for more read Laravel service provider

Lumen route caching is not working

When I am trying to run php artisan route:cache in lumen project, I am getting following error,
[invalid argument exception]
There is not commend defined in the 'route' namespace.
My route file is,
$app->get('/', 'App\Http\Controllers\WebController#index');
Any idea?
This command exists only in Laravel and in Lumen it does not. it is not needed as Lumen is anyway optimized for best performance.
Type php artisan to see all possible commands in Lumen.

Categories