Laravel 5.1 Php artisan commands not working after composer update - php

here is my composer.json require snippet.
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.35",
"aws/aws-sdk-php-laravel": "~3.0",
"lucadegasperi/oauth2-server-laravel": "5.1.*",
"bosnadev/repositories": " 0.*",
"laravelcollective/html": "5.1.*",
"cartalyst/stripe-laravel": "3.0.*"
},
I ran composer update in order to add new AWS services. but then I noted that all the vendor files are updated because of composer update command. now I'm getting error when I ran php artisan commands.
This is the error message:-
PHP Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator
::__construct() must be an instance of Illuminate\Http\Request, null given, call
ed in C:\Users\User\projects\projectxyz\projectxyzweb\vendor\laravel\framework\
src\Illuminate\Routing\RoutingServiceProvider.php on line 62 and defined in C:\U
sers\User\projects\projectxyz\projectxyzweb\vendor\laravel\framework\src\Illumi
nate\Routing\UrlGenerator.php on line 102
How can I resolve this issue? is there any wayto revert composer update without loosing my code?

I finally manage to get rid of this error. I was not my composer update. I have added url() to set base url in my config files. After removing it php artisan worked.

Related

laravel spatie issue with lada-cache

Laravel spatie producing issue with lada-cache.
It seems it is taking wrong instance to execute query.
exception: "Symfony\Component\Debug\Exception\FatalThrowableError"
file: "/var/www/html/project-name/vendor/spiritix/lada-cache/src/Spiritix/LadaCache/Reflector.php"
line: 126
message: "Argument 1 passed to Spiritix\LadaCache\Reflector::getTablesFromWhere() must be an instance of Spiritix\LadaCache\Database\QueryBuilder, instance of Illuminate\Database\Query\Builder given, called in /var/www/html/project-name/vendor/spiritix/lada-cache/src/Spiritix/LadaCache/Reflector.php on line 145"
Package Information :
"php": ">=7.2",
"laravel/framework": "5.8.*",
"spatie/laravel-permission": "^2.9",
"spatie/laravel-server-side-rendering": "^1.1",
"spiritix/lada-cache": "^3.0".
Even I am getting the same result after updating the package.

Geolocation package with laravel: Midnite81\Geolocation\GeoLocationServiceProvider' not found

I want to use the following package for geolocation with laravel.
https://github.com/midnite81/geolocation
I have done everything they wrote in their documentation but find an error
Midnite81\Geolocation\GeoLocationServiceProvider' not found
i am unable to solve this problem. Can't understand what's wrong. What i did, at first, write "midnite81/geolocation": "1.*" in the composer.json file.
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"midnite81/geolocation": "1.*"
},
After that run composer update. Then run composer dump-autoload -o. Then in the config/app.php file, put the following part in providers and aliases array.
'providers' => [
Midnite81\Geolocation\GeoLocationServiceProvider::class
];
'aliases' => [
'GeoLocation' => Midnite81\GeoLocation\Facades\GeoLocation::class,
];
then run the following command.
php artisan vendor:publish --provider="Midnite81\GeoLocation\GeoLocationServiceProvider"
Then got the error, Midnite81\Geolocation\GeoLocationServiceProvider' not found
Can't figure out what's wrong in it.
I verified and confirm the problem.
The problem is:
Midnite81\Geolocation\GeoLocationServiceProvider::class
You should change this into
Midnite81\GeoLocation\GeoLocationServiceProvider::class
Notice the difference Geolocation vs GeoLocation. It seems there is error in readme for this package on Github
I've already sent Pull request https://github.com/midnite81/geolocation/pull/2 to fix readme for this package

Codeception actor not found exception

When running codecept run -vvv I get an error stating that the actor is undefined in the SuiteManager class (method is initialize).
Any guess on how to fix this?
I've set up two basic unit tests where I just want to assert some values, and they worked until I switched to the composer autoloader.
In the composer.json I have the following:
"autoload": {
"classmap": [
"app"
]
},
"require-dev": {
"codeception/codeception": "^2.3",
"phpstan/phpstan": "^0.8.0",
"symfony/console": "^3.3"
}
In the main _bootstrap file provided by Codeception I only have a require_once for the vendor autoloader file.
Using php 7.1 and latest versions of the packages.

How do i upload to amazon s3 using Heroku composer amazon aws sdk

I'm using heroku and i'm following this tutorial here, https://devcenter.heroku.com/articles/s3-upload-php
I have placed the composer require line in my composer.json file as shown below.
{
"require" : {
"silex/silex": "~1.1",
"monolog/monolog": "~1.7"
},
"require-dev": {
"heroku/heroku-buildpack-php": "*"
},
"require" : {
"aws/aws-sdk-php": "~2.6"
}
}
As you can see i placed the amazon one last. However, i'm receiving the following error message.
2015-02-27T16:26:05.499004+00:00 app[web.1]: [27-Feb-2015 16:26:05 UTC] PHP Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /app/web/fb/fileupload.php on line 4
Does anyone know if i have to do anything other than place that line in my composer json file???? please help
You now have two "require" keys, how is that supposed to work? It's a hash map, the keys overwrite each other!
This is what you want:
{
"require": {
"silex/silex": "~1.1",
"monolog/monolog": "~1.7",
"aws/aws-sdk-php": "~2.6"
},
"require-dev": {
"heroku/heroku-buildpack-php": "*"
}
}
And then you of course have to run composer update to generate a composer.lock, and check that into the repos along with the rest of your code.
Why don't you run the app locally on your computer before pushing it up to Heroku?
So looks like an include can not find vendor/autoload.php
Are you sure that it exists?
vendor folder should be in fb folder an have that file.
Remember it is case sensitive.
Just make sure that you point to proper file on an include.
Make sure you ran composer install

Laravel Traits Error

Fresh install of Laravel, trying to run anything generates a Traits error:
Trait 'Illuminate\Support\Traits\MacroableTrait' not found in /var/www/laravel/bootstrap/compiled.php
I have tried manually adding in \Traits\MacroableTrait.php and this now generates a new error:
Trait 'Illuminate\Http\ResponseTrait' not found in /home/vagrant/innovedV2API/bootstrap/compiled.php
Any ideas what's happening here?
Try to edit your composer.json in a way to put all "require" elements together, like this:
"require": {
"laravel/framework": "4.2.*",
"dompdf/dompdf" : "dev-master",
"stripe/stripe-php" : "dev-master",
"fzaninotto/faker" : "dev-master"
}
I think my error was that I have written another require block with faker, dom and stripe at the end of the file, and tried to run composer update like that.
Another error may be migrating databases before composer update, or artisan db:seed

Categories