Laravel Error - Class 'Facade\Ignition\IgnitionServiceProvider' not found [closed] - laravel

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last year.
Improve this question
In google cloud console, when I deploy project using command php artisan config:cache, it shows error :
In Application.php line 690: Class 'Facade\Ignition\IgnitionServiceProvider' not found

I had to delete the vendors folder and then run
composer install
to make everything fall in place and to get rid of the error!

You have to run the composer dump-autoload command which won't download anything new, but looks for all of the classes it needs to include again. It just regenerates the list of all classes that need to be included in the project.

composer dump-autoload didn't work for me. I deleted vendor folder and run composer update and I can run php artisan again

Deleting the vendor folder and using the composer update command worked for me.

first Check Server.php file is still in the root folder
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* #package Laravel
* #author Taylor Otwell <taylor#laravel.com>
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
require_once __DIR__.'/public/index.php';
then run
composer update
and then project will start without any issue

Related

Cannot locate class of installed package

I'm writing a laravel package which contains spatie/laravel-sitemap.
I already included several external packages and I didn't encountered any issues, but for some reason I'm not able to integrate this one.
What I did is the usual:
composer require spatie/laravel-sitemap
Then I have created a Console command that have as handle method the following content:
public function handle()
{
SitemapGenerator::create(config('app.url'))
->configureCrawler(function (Crawler $crawler) {
$crawler->ignoreRobots();
})
->writeToFile(public_path('sitemap.xml'));
$this->line('<info>Sitemap generated');
}
when I execute the command registered as:
php artisan myapp:sitemap
I get:
Class "Spatie\Sitemap\SitemapGenerator" not found
The reference imported are:
use Spatie\Crawler\Crawler;
use Spatie\Sitemap\SitemapGenerator;
I also tried composer update and composer dump-autoload, same problem.
Any help?
register package class in providers array in config/app.php
Spatie\Sitemap\SitemapServiceProvider;
in the bottom of app.php file
i hope it was useful.
you can publish package using this.
php artisan vendor:publish --provider="Spatie\Sitemap\SitemapServiceProvider" --tag=sitemap-config
then
composer dump-autoload
for more details please check the document https://github.com/spatie/laravel-sitemap under Configuration

PHP Artisan tinker Class 'XdgBaseDir\Xdg' not found

I encountered and error when running php artisan tinker in my current project. I tried to create a new project using laravel new projectname but the same error occurs when running php artisan tinker.
This is the error that occurs.
````Class 'XdgBaseDir\Xdg' not found
````at C:\xampppp\htdocs\someProject\vendor\psy\psysh\src\ConfigPaths.php:34
````30| * #return string[]
````31| */
````32| public static function getConfigDirs()
````33| {
````> 34| $xdg = new Xdg();
````35|
````36| return self::getDirNames($xdg->getConfigDirs());
````37| }
````38|
````1 C:\xampppp\htdocs\someProject\vendor\psy\psysh\src\ConfigPaths.php:90
````Psy\ConfigPaths::getConfigDirs()
````2 C:\xampppp\htdocs\someProject\vendor\psy\psysh\src\Configuration.php:392
````Psy\ConfigPaths::getConfigFiles()
I badly need help. Thank you so much for anyone that knows the solution.
Finally found the solution. I ask my senior if I can copy his vendor files and a composer update followed. What a relief. Thank you still. Peace out!
(Edit)
If you have a working vendor files, you can copy and paste it to the project files folder where you encounter the said error above. Then do a composer update and your all set.
try this one it worked for me probably you don't have the package installed in the vendor
composer require dnoegel/php-xdg-base-dir
I only had to run composer update

Is NetBeans not accepting _ide_helper from Laravel?

Using NetBeans 8.2 with Laravel, I'm setting the _ide_helper.php to my project as described in his link https://github.com/barryvdh/laravel-ide-helper,
it was set on terminal the command
composer require barryvdh/laravel-ide-helper
then after, it was added into config/app.php the line
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
and for last, the command on the project folder
php artisan ide-helper:generate
but nothing has changed apparently. No auto complete, no references. Here are some images comparing what is expected and what is happening.
Expected
Happening
Plus, NetBeans is marking an error inside the ide_helper file which confuses the syntax by the name of the function ('if'). I'll put an image of the part showing the error
Error_NetBeans_ide_helper
I've rebooted NetBeans, tried downloading and setting directly the file, but no lucky. Is the function 'if' causing the problem? Or is NetBeans not accepting the _ide_helper?

Class 'Socialite' not found [duplicate]

This question already has answers here:
Laravel Class Socialite not found
(9 answers)
Closed 5 years ago.
I am using Socialite package in my app. I followed all the instructions from the official github page. I am using Laravel 5.4.27. When I try to run the app, I get "Class 'Socialite' not found"error. What do I need to do??
I have also added use Socialite;, Laravel\Socialite\SocialiteServiceProvider::class, and 'Socialite' => Laravel\Socialite\Facades\Socialite::class, and I am using version 3 of socialite.
Here's the controller:
<?php
namespace App\Http\Controllers\Auth;
use Socialite;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class SocialLoginController extends Controller {
public function redirectToProvider($service, Request $request) {
return Socialite::driver($service)->redirect();
}
public function handleProviderCallback($service, Request $request) {
}
}
What do I do?
Try composer dump-autoload
composer install installs the vendor packages according to composer.lock (or creates composer.lock if not present),
composer update always regenerates composer.lock and installs the lastest versions of available packages based on composer.json
composer dump-autoload won’t download a thing. It just regenerates the list of all classes that need to be included in the project (autoload_classmap.php). Ideal for when you have a new class inside your project.
Ideally, you execute composer dump-autoload -o , for a faster load of your webpages. The only reason it is not default, is because it takes a bit longer to generate (but is only slightly noticable)
EDIT:
Also clear the config cache:
php artisan config:clear
If all this stuff do not help, try this answer (find in old stack questions like "socialite not found"):
https://stackoverflow.com/a/28451747/7155723
Hope it will help you :)

CodeIgniter + omnipay installation

I have used ci-merchant before but from everything see that the "V2" of it is now omnipay. I use codeigniter and i'm struggling to get even the example to work.
I have installed omnipay no problems and in my controller have the following:
use Omnipay\Common\GatewayFactory;
class Homepage extends BC_basecontroller {
public function index()
{
$gateway = GatewayFactory::create('PayPal_Express');
$gateway->setUsername('adrian');
$gateway->setPassword('12345');
}
}
Which is the example here: https://github.com/adrianmacneil/omnipay
However I get the error:
PHP Fatal error: Class 'Omnipay\Common\GatewayFactory' not found in......
Does anyone know how to get it to work in CI?
I'm not sure how you installed Omnipay, but you need to use Composer to load the classes before you can use them.
So following the Omnipay installation instructions, add this to a composer.json file in your root directory:
{
"require": {
"omnipay/omnipay": "*"
}
}
Then install the files:
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
Now, if you are using CodeIgniter you will need to set it up to include the composer autoloader. Basically, just add this line to the top of your index.php file:
require_once __DIR__.'/vendor/autoload.php';
There is also a tutorial on using Composer with CodeIgniter here which you may find helpful: http://philsturgeon.co.uk/blog/2012/05/composer-with-codeigniter
I had the same error and fixed it by loading vendor/autoload.php before application/core/CodeIgniter.php

Resources