Class 'Stripe\Stripe' not found error in PHP - cmd

I installed laravel and composer and created my first project in laravel. I want to integrate stripe using PHP. When I try to execute my first project in localhost I take this message:
Fatal error: Class 'Stripe\Stripe' not found in C:\xampp\htdocs\laravel\stripe\public\elda.php on line 21
To include the stripe libraries, I inserted inside the composer.json file the code from the API library for PHP. Here is an image of my composer.json file:
I run composer install in cmd and this is the output:
You may be getting outdated dependencies. Run update to update them.
I run composer update and the output is the error in the image below:
Can someone help me to solve this error?

Well, sorry did not make a comment of your post, but I have not enough points to do so. But you need to run composer install in the terminal after that includes a new package.

I had the same issue, but when I ran this command my issue is resolved.
composer require stripe/stripe-php
I hope this may help you, after you update your composer.

Related

Running composer install doesn't resolve undefined type error in cloned Laravel project

I've cloned a Laravel project from Github, then I've run composer install for getting vendor folder. This folder has appeared but I also get weird red lines under each class that show Undefined Type errors. I also deleted the composer.lock and run composer update, but the errors are still there!
Is there any other thing that I should do?
The project was running perfectly, So I found out it was because of my IDE.
The VS Code wanted to validate code using php, and it is not finding php installed.
It's solved by setting php.validate.executablePath in Vs Code setting.
For more information: "Cannot validate the php file. The php program was not found"

Not found Class 'Jenssegers\Agent\Agent' not found in Laravel

I have tried many times to install laravel on ubuntu 18.04. but there is a error showed in terminal. Please help me how to solve this.
user#user:/opt/lampp/htdocs/project$ php artisan serve
In constants.php line 4:
Class 'Jenssegers\Agent\Agent' not found
Autoloading
You have to be sure, that your autoloading file is up to date.
Also, be sure that all packages from your composer.json are installed currently.
composer install will take care of both.
Wrong class name
If you have checked the above the issue could be, that the autoloader is looking for a class name, that doesn't exists due to discrepancy between the filename and classname. E.g. you called the file "UserAgent.php", but the class name inside the file is "Agent".
you can run composer install to fix the error. it works for me.

Composer [InvalidArgumentException] Could not find package mtibben/html2text

I have tried to install html2text via composer to my laravel application. Here is a link to the html2text repository. https://github.com/mtibben/html2text
I have tried composer require mtibben/html2text giving this error:
[InvalidArgumentException]
Could not find package mtibben/html2text at any version for your
minimum-stability (stable). Check the package spel ling or your
minimum-stability
Also I have tried composer require https://github.com/mtibben/html2text.git giving this error:
[UnexpectedValueException]
Could not parse version constraint //github.com/mtibben/html2text.git:
Invalid version string "//github.com/mtibben /html2text.git"
How do I install html2text?
Its a php package, u can't install with composer require
U may want to read this tutorial
http://laraveldaily.com/how-to-use-external-classes-and-php-files-in-laravel-controller/
Do you already have a composer.json file in your directory? If not, this could be the error, because in this file you will configure which version of the package you want to install in to your project.
The second exception gives a hint to that missing version!
If you have a composer.json file please add its content to your question, so that we can take a look at it.
Here you can find further informations:
https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup
i faced the same problem.
And neither the creation of releases, nor any tags helped.
The solution for me turned out to be updating the composer from last version.
it's for composer, nothing else. If you already installed composer and composer version is 2 then convert it to version 1.easy way to solve this problem is ,delete the composer folder from your system and re install it. download from here: https://getcomposer.org/

Compiled Services Class Has been removed Composer error laravel 5.4

Dears whenever i want to add any Packeg using composer i face below error
"Compiled Services Class Has been removed"
I search many solution like "composer update" etc but still i face this problem
due to this error my working is stop.
kindly help me whats the original solution.
thats the composer installation problem? or what ?
The message The compiled services file has been removed. is a info message from the clear compiled command: php artisan clear-compiled.
It is called from php artisan optimize that runs on every composer update or install.
The message is only a info reporting that the file bootstrap/cache/services.php has been removed.
The services.php file will be reconstructed at the next request.
So at the end its a normal info message.
I have encountered the same problem.
Just remove the "Vendor" folder then install the composer. It worked fine for me.

How to install Laravel 4 profiler

I'm a Ubuntu/git/composer noob, and I'm trying to follow the installation instructions here.
After running the php artisan config:publish loic-sharma/profiler command I get the following error:
PHP Fatal error: Class 'Profiler\ProfilerServiceProvider' not found in /var/www/epcr/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158
I'm assuming the problem is that I haven't downloaded the code, but I'm not exactly sure how to go about doing that.
Most packages require you to manually add service provider in app/config/app.php. There is an array of providers inside.
Some providers require also facade alias.
So take a look at documentation, if it is provider, then it should be documented.
e.g.
'Miro\JSONSuite\JSONSuiteServiceProvider'
Try running composer dump-autoload
I needed to run composer update after I added the require to my composer.json file. After that I had a few permissions I needed to update and it worked after that.

Resources