Error while upgrading laravel from 5.0 to 5.1 - php

Today I decided to upgrade my app from Laravel 5.0 to 5.1. But while upgrading, I am facing the following issue:
Catchable fatal error: Argument 1 passed to Illuminate\Config\Repository::__construct() must be of the type array, integer given, called in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 32 and defined in /home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Config/Repository.php on line 23
Please help me. I need to get my app up and running once again. Thank You.

I was facing the same error, and the issue was:
I created manually the files compiled.php, routes.php, config.php, and services.json inside bootstrap/cache folder, but those files do not need to exist, they will be generated by Laravel application.
https://github.com/laravel/laravel/tree/master/bootstrap/cache

del storage/bootstrap/cache/[files], this resovle my problem

Related

Call to undefined method Illuminate\Routing\RouteFileRegistrar::get() - Error after upgrading from Laravel 5.7 to 5.8

I have a running app written on Laravel 5.7. I tried to change the record in composer.json to match "5.8.*" and ran composer update. On my local (win10/WAMP) machine it went fine, but on the staging server (Debian 9/nginx) the update command changed the vendor contents and failed at the end.
Since then anything I do with the app on the server I get this error and I can't find any information anywhere.
Call to undefined method Illuminate\Routing\RouteFileRegistrar::get()
And this is the line that fails:
$this->get('login', 'Auth\LoginController#showLoginForm')->name('login');
Thanks in advance!
remove "$this" from your routes and use "Route::"
It is a problem with the routes. Mainly, you get this problem when you are using routes with resource or resources. Make sure you do not have any problem in routes by using the command:
#php artisan route:list
If you are getting any problem while route listing please fix it.
I solved this problem in Laravel 5.8 by fixing routes.
Hope this will help.

Logger does not work anymore after upgrade from Laravel 5.5

Since I've upgraded to Laravel version 5.6 from Laravel version 5.5 my Logger doesn't work properly anymore.
At first I got the following error stack :
laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /home/vagrant/Code/grotesmurf/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:181)
which was solved by simply adding the new config/logging.php file that is provided by Laravel 5.6.
But now I'm getting no output from the Logger! I'm simply running \Log::info('hello!') as a tinker command, but it doesn't generate any log output anymore (same for scripts calling the \Log() method).
I've tried different LOG_CHANNEL settings (daily, single, stack), but none of these work.
Hope anyone has ran into this error already and is able to provide me with some suggestions. I have followed the upgrade guide and it doesn't help unfortunately.
Thanks in advance.
P.S. I'm running php version 7.1 & am on ubuntu.
P.P.S. I have cleared all cached config using artisan.
Well I have found the actual problem, we use an adjusted storage_path() method in our application and the new Logger is now using the storage_path() method to generate its path - this caused the log file to be created in a different directory than storage/logs.
i had the same issue, deleting the files in bootstrap/cache solved it.

Laravel Scout, Lumen application gives [ErrorException] Missing argument 1 for Illuminate\Support\Manager::createDriver()

When deploying lumen application with Codeship I get an error
[ErrorException]
Missing argument 1 for Illuminate\Support\Manager::createDriver(), called i
n /home/rof/src/bitbucket.org/rakkle/rakkleapi/vendor/illuminate/support/Ma
nager.php on line 88 and defined
It comes when the deployment runs the seeder class for the eloquent model associated.
I don't get this error on my local machine. In the bootstrap/app.php I have added
$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');
$app->configure('scout');
$app->register(Laravel\Scout\ScoutServiceProvider::class);
$app->register(ScoutEngines\Elasticsearch\ElasticsearchProvider::class);
Yes I am using a custom scout engine, which works perfect on my machine.
I have come to a point where I know it's laravel/scout package giving the problem because when I remove the Searchable trait from the eloquent class that's giving the problem, the deploy run successfully.
I would like some insight and some direction in solving this issue.
Thanks
I found a solution to this problem.
Here's the full error that I duplicated on my machine
ErrorException: Missing argument 1 for Illuminate\Support\Manager::createDriver(), called in /var/www/vendor/illuminate/support/Manager.php on line 88 and defined
/var/www/vendor/illuminate/support/Manager.php:77
/var/www/vendor/illuminate/support/Manager.php:88
/var/www/vendor/illuminate/support/Manager.php:63
/var/www/vendor/laravel/scout/src/EngineManager.php:21
/var/www/vendor/laravel/scout/src/Searchable.php:203
/var/www/vendor/laravel/scout/src/Searchable.php:56
/var/www/vendor/laravel/scout/src/Searchable.php:35
/var/www/vendor/illuminate/support/Traits/Macroable.php:78
/var/www/vendor/laravel/scout/src/Searchable.php:112
/var/www/vendor/laravel/scout/src/ModelObserver.php:61
/var/www/vendor/illuminate/events/Dispatcher.php:367
/var/www/vendor/illuminate/events/Dispatcher.php:199
/var/www/vendor/illuminate/events/Dispatcher.php:172
/var/www/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php:148
/var/www/vendor/illuminate/database/Eloquent/Model.php:670
/var/www/vendor/illuminate/database/Eloquent/Model.php:518
/var/www/vendor/illuminate/database/Eloquent/Builder.php:734
/var/www/vendor/illuminate/support/helpers.php:936
/var/www/vendor/illuminate/database/Eloquent/Builder.php:735
/var/www/vendor/illuminate/database/Eloquent/Model.php:1357
/var/www/vendor/illuminate/database/Eloquent/Model.php:1369
/var/www/tests/PetListingTest.php:150
/var/www/tests/PetListingTest.php:93
What I had forgot to add was within the environment variables in codeship was the SCOUT_DRIVER that I was using for the search. I had it within the .env file, reason why it wasn't giving me the issue on my machine.

laravel artisan app:name resulted in syntax errors

I am using Laravel 5 on a shared host. I have installed it ok. However on running:
/usr/bin/php55-cli artisan app:name 247
the laravel install broke. I tracked it down to app.php and the new name caused syntax errors. I got it working again by using Linux to do a global replace changing it back from 247 to App.
Does anyone know why? And how can I get artisan to work properly?
Thanks
This is not Laravel nor artisan issue, but plain PHP syntax error.
PHP does not allow variable or class name to start with an integer. Same goes to namespaces. So your error comes from you app name being 247. First letter can not be an integer.

Laravel FatalErrorException in Handler.php line 25

I'm getting the following error on random occasions, working on a Laravel 5.1 project on the latest homestead with PHP7
FatalErrorException in Handler.php line 25:
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of TypeError given, called in /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /home/vagrant/Code/henau/app/Exceptions/Handler.php:25
Stack trace:
#0 /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): App\Exceptions\Handler->report(Object(TypeError))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(TypeError))
#2 {main}
thrown
Even when I undo work that has been causing it, It stays. It's being caused by this block of code in this instance
\Mail::send('emails.registered', $user, function ($m) {
$m->to('miguel#dummyaddress.com')->subject('New Order');
});
It seems to me the error is not directly code-related. I've seen other people encounter it in complete different situations. And i've seen it popup in older threads regarding Homestead and PHP7. There was an askubuntu thread but it's offline, So I hope we can reopen the discussion here.
Solution
This is actually an error that an exception can't be shown. This is caused by using PHP7.x on an older Laravel project that requires PHP5.6.x
My solution was to create a new Homestead specific for this project and install php5.6 on that homestead using an older version of laravel/homestead
I had the same problem when running seeders Notflip . I'm usign Laravel framework 5.0.34. I had this structure:
App/Models/Users/ (My users's Models here)
After moving my users's models to the App directory, my seeder problem was solved.
Check your namespaces and put under consideration your Laravel Framework version before make changes in the framework.
Hope it helps!
This situation occur when laravel project version not compatible or not configured with your local installed version So the laravel not tracking the exact error and instead of showing exact error on line shows that type of errors
i had same problem in laravel 5.1. After reading this issue, i found out i was using laravel v5.1.0 and that seemed wrong so changed 5.1.0 to 5.1.* and ran composer update. this solved the issue for me.

Categories