Laravel with App Engine Standard Class 'Facade\Ignition\IgnitionServiceProvider' not found - php

This is driving me crazy second day. I'm new to Laravel and trying to get Laravel 6 work on Google App Engine Standard.
Tried: This tutorial and other ones, but it still fails to load Laravel index page
What I have done:
Created new Laravel project
Checked that Laravel is working on local host with php artisan serve
Generated new key with php artisan key:generate --show
Created app.yaml file with:
runtime: php72
env_variables:
APP_KEY: iktbUa2quYPV2av3zDx0XAuEVjwzVQY/oMfyI2PQNKk=
APP_STORAGE: /tmp
VIEW_COMPILED_PATH: /tmp
SESSION_DRIVER: cookie
Modified bootstrap/app.php by adding $app->useStoragePath(env('APP_STORAGE', base_path() . '/storage'));
Rancomposer remove --dev beyondcode/laravel-dump-server
Also ran:
php artisan cache:clear,
php artisan route:cache,
php artisan config:clear,
php artisan view:clear (as other tutorials suggested)
And gcloud app deploy
And I get error: "Class 'Facade\Ignition\IgnitionServiceProvider' not found"

If you're facing this issue after upgrading composer 1.0 to 2.0. Then you can follow this step:
Go to the project directory
Run composer install
Run composer dump-autoload
Try to run php artisan serve
It solved for me

Please Try
composer dump-autoload
It solved for me

App engine install dependency with "--no-dev" flag. If your application is debug mode and there is an error application is try to render error page by "facade/ignition" packages.
Solve-1: You can move "facade/ignition" dependency from "require-dev" to "dev" in composer.json file
Solve-2: You can run as production environment and with false APP_DEBUG flag

I have experienced other errors as well, most of them gave me Error 500 and
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /tmp/google-config/nginx.conf:3 in Stackdriver Logger
Also I was not aware that App Engine was executing composer.json on build (see Specifying Dependencies). And it seems the issue was that it cached that.
Everything was resolved by replacing command in step 7. :
gcloud app deploy with gcloud beta app deploy --no-cache
It seems that if I would have done all steps as in tutorial from the start I would not have any issues.

Try
php artisan route:clear
and you're good to go.

I try
composer update
and its working fine

Try running
composer update
or
composer dump-autoload

Go to your project terminal and run :
composer install
composer dump-autoload
php artisan serve
And your problem will go away.

I am also new to Laravel and I have experienced with this issue, and I searched solution which was
first run this command on your terminal
composer update
second run the command on below
composer dump-autoload
and then see the result :)

just uncomment soduim line from your ini file
before
;extension=sodium
after
extension=sodium

If you are facing this issue while running phpUnit tests then try to clear cache of bootstrap folder.

Related

Cache clear probem in Larave

I have a problem. I am download project from hosting. now when I run the project this error shows.
pic attached.
I think this is cache problem, I clear cache, view, but still same issue.
let's say you have installed composer,
now run this command and see:
composer dump-autoload
Just delete the vendor directory and composer.cache file from project root and hit the following commands.
composer install
php artisan optimize:clear
php artisan serve
Through these, you can also check if there is any composer-related issue.

Laravel clear package auto-discovery cache of composer packages

I wanted to remove a package from laravel. I did composer remove vendor/package
It was all good on my dev, but when I deploy on production something went wrong and I cannot do anything now.
when I run
php artisan package:discover
I'm geting
In ProviderRepository.php line 208:
Class 'Laracasts\Flash\FlashServiceProvider' not found
I'm guessing I it is something to do with some kind of cache or maby config
but I cannot run this command,
php artisan config:clear
because I'm getting the same error message as above.
PS. I'm using Laravel 5.6
You may need clear the autoloader files if they get jammed up as it is looking at those cached files when php artisan config:clear runs, thus creating the jam.
Remove the following files and they will rebuild:
/bootstrap/cache/packages.php
/bootstrap/cache/services.php
I fixed my problem deleting a config file like so:
$rm bootstrap/cache/config.php
This file is basically a cache for config, if you want to have this file built for you just run a following artisan command:
$php artisan config:cache

Laravel 5.5 - Issues creating new project

I'm trying to use Laravel 5.5. I updated my php 7.0 to php 7.1. Even, I update my laravel installer package. But, when I try to do:
laravel new myProject
I get this error:
You made a reference to a non-existent script #php -r
"file_exists('.env') || copy('.env.example', '.env');" You made a
reference to a non-existent script #php artisan key:generate
Illuminate\Foundation\ComposerScripts::postAutoloadDump You made a
reference to a non-existent script #php artisan package:discover
I am using laravel valet and if I go to the browser, when I try myProject.dev is not working. I see this error:
Whoops, looks like something went wrong.
I tried using:
php artisan key:generate
inside my project, but I got that:
[ErrorException]
file_get_contents(/Users/jorgeJimenez/Sites/laravel5-5/.env): failed
to ope n stream
: No such file or directory
I noticed, my laravel 5.4 projects are working. I copied a .env file and I put on my laravel 5.5 projects. After that, I run
php artisan key:generate
and the key was generated and my project in the browser works.
It's supposed, all that process is automatic, but I am not quite sure what is happening.
You can try update your composer:
composer self-update
I had the same problem. Then I found that there was no problem when i created the first project use laravel 5.5. so I clear composer's cache dir. It works well now.
This is because of your Laravel Installer or Composer version. I have faced the same problem and found following 2 different solutions:
Generally you can solve with by running composer global update command and then run composer update command from your project directory. This solution basically updates your installer and then your project.
If still, you have this issue, you need to run composer self-update command first and then run composer update command from your project directory. Here your composer will update and then your project.
Hope this answer will help you.

Vendor:Publish - Nothing to publish for tag [] - Only on production server

I am using a third party library and locally, I installed everything using the steps that they provided.
I ran composer require on the package and ran an update. This installed into the vendor folder.
I then added the path into the provider in config/app and also as an aliases..
I ran php artisan vendor:publish --provider="Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider" the config file created successfully and I had no problems.
I then uploaded to the production environment and kept on getting Class 'LaravelAnalytics' not found and I can't seem to figure out the problem..
I ran php artisan vendor:publish --provider="Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider"
But I kept on getting: Nothing to publish for tag []. which has lead me to thinking that this could be the problem since the package is not published.
My local environment is Ubuntu and my production Environment is CentOS.. If I try to CD into that directory on my production environment it says cannot find.
Could this therefore be a problem with the case sensitive on how I am adding my providers that is not picking up this package?
are you using cached config files ?
try using
php artisan config:clear
and retry
php artisan vendor:publish
You have to save all for the project before (php artisan vendor:publish).

Auth resources are missing in laravel

I want to make use of auth system which comes with the laravel package but the problem is when I make new laravel package using composer i.e composer create-project laravel/laravel project name --prefer-dist
it do not install those auth resources which includes (i.e. auth folder inside resources > views) and also I can't find the Services Folder inside app directory.
All other things are working fine except this authentication system.
What can be the possible problems? Please give me solution
I am working with MAMP.
Taylor Otwell has made it opt-in for Laravel 5.1
You need to run following command after installation
php artisan scaffold:auth
UPDATE
I think this has been answered here
You could also run the command php artisan make:auth in the root directory of you laravel project. I had the same problem and it worked for me.
The command php artisan scaffold:auth didn't work for me i don't know why.
it issued the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "auth" is not defined.
Did you mean this?
make:auth
in Laravel 5.2 you just have to run this command "php artisan make:auth" and the auth folder will be created
Since laravel 6.* version make:auth is no longer supported, use ui:auth instead.
For deploying ui pack run
composer require laravel/ui --dev
then update composer.json :
composer update -W
and do the:
php artisan ui:auth
You need execute
php artisan make:auth
now if your style css and js are missing
You need load file .css and .js
1) execute in your project
npm install
2) then execute
npm run dev => now in folder /public now exist folder js and css
3) reload page

Categories