Laravel 5.4 Bootstrap cache force delete - laravel-5

I have a question. In my case AM 1:00 some-laravel project/bootstrap/cache/services.php was force deleted, but I don't know the reason. Our code doesn't have any call artisan clear cache command, and anyone doesn't call artisan command manually. Does anybody have the same case as my case? If you have the same case as my case and find cause plz comment, my question causes our environment.
AWS EC2
laravel version : laravel 5.4.33
php version : PHP 7.1.4 (cli) (built: Oct 26 2017 15:49:30) ( ZTS )
Apache version: Apache/2.2.15 (Unix)
OS : CentOS release 6.9 (Final)
dependency
{
"php": ">=5.6.4",
"ammadeuss/laravel-html-dom-parser": "^1.0",
"aws/aws-sdk-php": "^3.160",
"barryvdh/laravel-debugbar": "^2.3",
"caouecs/laravel-lang": "~3.0",
"doctrine/dbal": "^2.5",
"fightbulc/moment": "^1.26",
"graham-campbell/exceptions": "^9.3",
"ixudra/curl": "^6.10",
"laracasts/utilities": "^3.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.4",
"php-imap/php-imap": "^3.0",
"phpoffice/phpexcel": "^1.8",
"phpoffice/phpspreadsheet": "^1.2",
"predis/predis": "^1.1",
"pusher/pusher-php-server": "^2.6",
"rap2hpoutre/laravel-log-viewer": "^0.10.0",
"yajra/laravel-oci8": "5.4.*"
}

Run
php artisan config:cache to recache the services

Related

Is there a way to check breaking changes of a php package?

At the moment I'm developing with Laravel and VueJs. I'm upgrading Laravel from 5.8 to 6.0 accordingly to the documentation.
It say's:
"Next, examine any 3rd party packages consumed by your application and
verify you are using the proper version for Laravel 6 support."
My package.json looks like this:
"require": {
"php": "^7.1.3", # [1] Successfully upgraded to 7.2
"barryvdh/laravel-cors": "^0.11.0",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0", # [2] Successfully upgradedto 6.0
"laravel/passport": "^9.3.2", # [3] Successfully upgradedto 9.3.2
"laravel/tinker": "^1.0",
"phpoffice/phpspreadsheet": "^1.4",
"pragmarx/version": "^0.2.8",
"pusher/pusher-php-server": "^3.4",
"santigarcor/laratrust": "5.2.*"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"orangehill/iseed": "^2.6",
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "3.*"
},
Now my question:
Is there a service (like a website) that I can use, to check if the package I want to update, got any breaking changes between my old and my new package version.
For example:
I want to upgrade barryvdh-laravel-cors from 0.11.0 to 2.0.4.
The documentation of barryvdh-laravel-cors have section for "Upgrading from 0.x / barryvdh-laravel-cors".
Is there an easier way, than go into the documentation every time and look up the breaking changes by myself?
Usually breaking changes managed by composer (by SemVer convention - https://semver.org/, all composer packages should follow it).
But, Laravel before version 6 is not following semver, so you need to check all your laravel-related packages manually, by inspecting package docs.

Cannot upgrade Laravel from 6 to 7 composer hangs

I'm trying to upgrade Laravel from v6 to v7. I followed the guide in the documentation, but when I run composer update nothing happens. I've tried waiting for hours and still nothing. Running composer in debug mode with composer update -vvv yields this:
Looking at all rules.
Something's changed, looking at all rules again (pass #521)
This is my composer.json file:
"require": {
"php": "^7.4",
"doctrine/dbal": "^2.9",
"fico7489/laravel-pivot": "^3.0",
"fideloper/proxy": "^4.4",
"google/protobuf": "v3.6.1",
"grpc/grpc": "^1.15",
"intervention/image": "^2.4",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.5",
"maatwebsite/excel": "^3.1",
"owen-it/laravel-auditing": "^10.0",
"phpmentors/workflower": "1.3.*",
"pragmarx/firewall": "^2.2",
"predis/predis": "^1.1",
"staudenmeir/eloquent-json-relations": "^1.1",
"superbalist/laravel-google-cloud-storage": "^2.1",
"guzzlehttp/guzzle": "^7.0.1",
"ext-json": "*",
"ext-bcmath": "*"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.9.1",
"facade/ignition": "^2.0",
"mockery/mockery": "^1.3",
"nunomaduro/collision": "^4.3",
"nunomaduro/larastan": "^0.6",
"phake/phake": "#stable",
"phpunit/phpunit": "^8.5.8|^9.3.3",
"symfony/process": "^4.5",
"symplify/easy-coding-standard": "^4.7",
"mnabialek/laravel-sql-logger":"2.2.8"
},
I believe all the required dependencies for laravel 7 are met but I cannot get arround the composer update problem. It gives no other information and I am lost at this point. I guess some of the packages has a problem with the update but then again, nothing fails. If I bump the version of say symmfony/process to 4.1, it starts throwing errors that are comprehensive and I can fix.
I hope someone has an idea of how I can fix this, or at least point me in the right direction.
NB. This is using composer 1.10. Composer 2 is the same.
Your dependencies won't work together: Laravel v7 requires Symfony in v5, so putting "symfony/process": "^4.5" in the list of packages can not be resolved (especially as there is no version of Symfony matching that constraint). Remove this constraint, as laravel/framework already requires symfony/process - you don't gain anything by requiring it once more.
Next up: phpmentors/workflower is not yet compatible with Symfony v5, this could also cause problems.

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with

when i do composer update t my laravel project
and after run any api this error appear
Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)
this is my composer.json file
"require": {
"php": "^7.1.3",
"astrotomic/laravel-translatable": "^11.1",
"bensampo/laravel-enum": "^1.26",
"brozot/laravel-fcm": "^1.3",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.5",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"mpociot/laravel-apidoc-generator": "^3.17",
"nwidart/laravel-modules": "^5.0",
"spatie/laravel-permission": "^2.37",
"tymon/jwt-auth": "dev-develop"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
and this my php version :
PHP 7.3.11-1+ubuntu16.04.1+deb.sury.org+1
Quick Google brought me to this issue on the Laravel repo: https://github.com/laravel/framework/issues/30655#issuecomment-558619927.
Had the same issue, quickest fix is to require "symfony/translation": "4.3.8" in your composer.json & run composer update
However this shouldn't be needed since the most likely cause is because locally you are using PHP 7.3 but where you get the error another PHP version is running, for example 7.2.
If that is the case you can run this command composer config platform.php 7.2 (replace 7.2 with 7.1 if that is the version you need) to tell composer which PHP version you are targeting, that allows you to use 7.3 locally but packages will be installed for the correct PHP version.

Update from Laravel 5.5 to 6

I am trying to update the Laravel5.5 project to 6.
What I tried is first describing the package update
"php": "^7.2",
"ext-SimpleXML": "^7.3",
"barryvdh/laravel-ide-helper": "^2.6",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.0",
"jeroennoten/laravel-adminlte": "^2.0",
"laravel/framework": "^6.0",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^6.0",
"maatwebsite/excel": "^3.1",
"laravel/ui": "^1.1",
"phpoffice/phpspreadsheet": "^1.9",
"phpoffice/phpexcel": "dev-master"
next
composer update
I get error
Call to undefined function str_slug()
So install this library
composer require laravel/helpers
Then this error came out
JeroenNoten \ LaravelAdminLte \ ServiceProvider :: class, not found
Reinstalling adminLTE doesn't help, commenting out and reinstalling doesn't work, I'm stuck and want help
I need help
Click here to resolve this error: Call to undefined function str_slug()
Remove space in config/app.php file:
'providers' => [
....
JeroenNoten\LaravelAdminLte\ServiceProvider::class,
],
Just run this command, It can automatically add all configurations to your project:
composer require jeroennoten/laravel-adminlte
More info about jeroennoten/laravel-adminlte
Open the composer.json file of your project (The configuration file of Composer) and change the Laravel framework . (Notice the caret, Laravel 6 makes use of semantic versioning scheme).
you are recommended to first upgrade your project to 5.8 then again upgrade to v6.
Next, save your composer.json file and run the following command:
$ composer update
Before you upgrade your project to v6, make sure your upgrade your PHP version from 7.1 to at least 7.2.
starting from December 2019, PHP 7.1 will not be maintained.

laravel upgrade to 5.7 from 5.6 composer not working

I am upgrading my laravel project to 5.6. current version is 5.5.38. my composer file is as below. when i run composer update, it does nothing but showing Loading composer repositories with package information
Updating dependencies (including require-dev) in the terminal for hours. what would be the issue for this?
"require": {
"php":">=7.1.3",
"laravel/framework": "5.6.*",
"fideloper/proxy" : "^4.0",
"guzzlehttp/guzzle": "~6.0",
"maatwebsite/excel": "v2.1.*",
"itsgoingd/clockwork": "1.*",
"barryvdh/laravel-ide-helper": "^2.2",
"anchu/ftp": "dev-master",
"pda/pheanstalk": "~3.0",
"nesbot/carbon": "1.20",
"laravelcollective/html": "~5.0",
"pusher/pusher-php-server": "~3.0",
"regulus/activity-log": "0.6.*",
"laravel/tinker": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"phpspec/phpspec": "~2.1",
"laracasts/generators": "^1.1",
"symfony/dom-crawler": "~3.1",
"symfony/css-selector": "~3.1",
"filp/whoops" : "~2.0"
},
The original poster fixed this by upgrading PHP, but for others (at time of writing, Laravel 5.5 is still the LTS version, so there will be many people upgrading from that soon), should Composer hang forever (as it did for me, despite running PHP 7.3):
A tip is to remove the entire require-dev section (the one that is only used on your dev environment) and see if it works, than add the packages back in again one at a time – on doing that, you might get an error like this with subsequent Composer commands (or more specifically, the Artisan commands, such as clear-compiled, that are launched by Composer):
In Application.php line 637:
Class 'Laracasts\Generators\GeneratorsServiceProvider' not found
…in which case, you probably need to comment out the appropriate line in app/Providers/AppServiceProvider.php::register() - also, try composer dump-autoload.
Another very useful option: composer-update --no-scripts
Laravel 5.6 now uses Symfony 4, not 3 (so you might switch to "~4.3")
There are some Symfony 4 requirements: https://symfony.com/doc/4.2/reference/requirements.html
Commit your existing copies of composer.json and composer.lock before you start, to make it easy to see what you've changed.

Resources