Laravel Error on Logging - laravel

I just cloned a project of a colleague of mine.
Configured httpd. But when I go to the landing page I get:
FatalThrowableError in ConfigureLogging.php line 59:
Call to undefined method Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler()
Laravel is 5.0. Does anyboy had the same issue?
EDIT
I solved this problem, because in config/app.php the variable 'log' was missing. But now:
Class 'Illuminate\Notifications\NotificationServiceProvider' not found

First, make sure that vendor/laravel/framework/src/Illuminate/Notifications/NotificationServiceProvider.php exists. If not, rm -r vendor; composer install.
Second, make sure that your autoload path is OK: In bootstrap/autoload.php, ensure that it says require __DIR__ . '/../vendor/autoload.php'; on line 17.
Third, dump all of your config cache: php artisan cache:clear.
Fourth, reinitialize the composer autoloader: composer dumpautoload.
Report back as to whether the problem is fixed or not.

Related

Laravel - compact(): Undefined variable: operator in Builder.php

I have PHP version-7.3 installed in my system and Laravel-5.8. When I tried to rub composer install or composer update on an old Project with Laravel-5.4 and PHP Version-5.6.4, I got this error shown below:
In Builder.php line 1229:
compact(): Undefined variable: operator
Script php artisan optimize handling the post-install-cmd event returned with error code 1
Then, when I tried to run the application, I got this error page as shown on the screen:
I tried to run:
php artisan cache:clear
and
composer update
but the problem is still there.
How do I get it resolved?
Thank you.
It looks like this issue was fixed in Laravel 5.5 according to this post: https://github.com/laravel/framework/issues/26936#issuecomment-449479336
Since Laravel 5.4 is no longer supported, your best option might be to upgrade. You can find a list of the currently supported versions here: https://laravel.com/docs/releases
The minimal upgrade that should still fix the error would be 5.4 to 5.5. The instructions can be found here: https://laravel.com/docs/5.5/upgrade#upgrade-5.5.0 (please note that support for 5.5 has also ended, but it might still fix your bug). This would also require you to switch the project to PHP 7.0.0 or greater.
If:
You can't upgrade for whatever business/team related reason and
Are sure that the Homestead box is running the correct version of PHP (7.2 or lower based on the answer given here) and yet
are still getting this error,
explicitly define the PHP version on the Homestead.yaml file. This should be done on the sites property as such (each is a new line, of course):
map: test.appp
/home/vagrant/code/test/public
php: "7.1"

how to fix error in laravel 5.2

i just doing now laravel 5.2 steam authentication
i am followed this link
https://github.com/invisnik/laravel-steam-auth## Heading ##
i got a error in composer
"Invisnik\LaravelSteamAuth\SteamServiceProvider::class class not a found"
i have add the composer.json file in
"invisnik/laravel-steam-auth": "2.*"
and composer install and then add
app.php
Invisnik\LaravelSteamAuth\SteamServiceProvider::class,
but this error will be display
"Invisnik\LaravelSteamAuth\SteamServiceProvider::class class not a found"
how can fix this error.
You need to import the class or declare it on the fly using by adding a backwards slash
\SteamServiceProvider
Eg:
\SteamServiceProvider::method()
And if you are adding a new package, make sure to run the following composer command to recatch the files.
composer dump-autoload

Cloudstack client installation

I have XAMPP installed on Windows 10. And have successfully installed Composer, Laravel. I can see the basic Laravel project page on my local server.
Just to try things out I also installed yii2. I can see the basic yii2 page also on my local server.
Now I'm trying to install this Generic Cloudstack Client:
https://github.com/PCextreme/cloudstack-client
In XAMPP, under htdocs I have this dir called 'LaravelProjects'.
dir structure
First I made the project with the laravel command:
laravel new PCextreme
Then in PCextreme directory I give the command:
composer require pcextreme/cloudstack-client:~0.1
The composer breaks and shows Conclusion: remove laravel/framework 5.2.41
But in the instructions there is another method to install the package.
When I do that by editting the composer.json in the main Laravel dir. 'LaravelProjects' under xampp/htdocs with these lines:
"require": { "pcextreme/cloudstack-client": "~0.1" }
And then I run the "composer update" command.
I don't get any error.
But as soon as I follow these steps:
Once the package is installed you need to open app/config/app.php and register the required service provider:
`'providers' => [
'PCextreme\CloudstackClient\Providers\LaravelServiceProvider']`
The application breaks.
I can't see the basic page showing 'Laravel 5' on my server anymore.
Instead of that I get a fatal error:
Whoops, looks like something went wrong.
1/1 FatalErrorException in ProviderRepository.php line 146: Class
'PCextreme\CloudstackClient\Providers\LaravelServiceProvider' not found
Further in the instructions, when I give the command below:
php artisan config:publish pcextreme/cloudstack-client
I get this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'PCextreme\CloudstackClient\Providers\LaravelServiceProvider' not found
I have tried out different things that I could find on internet but nothing seems to work in my case.
Could someone kindly help me out with this? Any help is greatly appreciated!
Execute in you project folder command: composer update

Composer error installing laravel-cors

I tried to install laravel-cors
composer require barryvdh/laravel-cors
It installed successfully or so I thought, but then when I went to publish the config I get this error:
[RuntimeException]
Error Output: PHP Fatal error: Cannot redeclare Composer\Autoload\includeFile() (previously declared in /www/vendor/composer/ClassLoader.php:410) in /www/config/vendor/composer/ClassLoader.php on line 413
I have tried removing laravel-cors and I still get this error. I have dumped autoload as well. What am I missing?
Larval 5.2 | PHP 5.6.17
I figured it out. When i typed
composer require barryvdh/laravel-cors
i was in a sub directory. so composer then installed it and the dependencies in a sub directory which is why i was getting that error. If you look closely you can see that it was installing in config
/www/config/vendor/composer/ClassLoader.php:413
/www/vendor/composer/ClassLoader.php:410
Just needed to pay better attention to detail.

Homestead - composer global require is trying to find an incorrect package

I am trying to install Laravel Homestead, and when I enter the following command:
composer global require "laravel/homestead=~2.0"
It returns the error "Your requirements could not be resolved to an installable set of packages."
However, the error shows laavel not laravel as I inputted! Why is it autocorrecting to an incorrect spelling? How can I resolve this?
In order to fix this, I did the following:
sudo open .composer and then within composer.json I rectified the line which was spelt incorrectly.
For some reason, Composer wasn't picking up Laravel and Laavel are spelt differently?!

Resources