Trouble upgrading to Laravel 4.1 - laravel-4

I'm having trouble upgrading to 4.1.
I've followed the upgrade guide in the docs but when I run composer update, I get the following error:
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
PHP Fatal error: Call to undefined method
Illuminate\Foundation\Application::bindShared() in
/site/vendor/laravel/framework/src/Illuminate/Queue/FailConsoleServiceProvider.php
on line 26
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call
to undefined method
Illuminate\Foundation\Application::bindShared()","file":"/site/vendor/laravel/framework/src/Illuminate/Queue/FailConsoleServiceProvider.php","line":26}}Script
php artisan clear-compiled handling the post-update-cmd event returned
with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method
Illuminate\Foundat ion\Application::bindShared() in /site/vendor
/laravel/framework/src/Illuminate/Queue/FailConsoleServiceProvider.php
on l ine 26
However, if I create a new project and use the same composer.json file, it runs successfully.
Can anyone point me in the right direction?
Here is the contents of my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"anahkiasen/html-object": "dev-master",
"anahkiasen/former": "dev-master",
"laravelbook/ardent": "dev-master",
"nesbot/Carbon": "*",
"jasonlewis/basset": "dev-master",
"robclancy/presenter": "1.1.*",
"way/generators": "dev-master",
"baum/baum": "dev-develop",
"loic-sharma/profiler": "1.1.*",
"thapp/jitimage": "dev-master",
"way/generators": "dev-master",
"jasonlewis/basset": "dev-master",
"cartalyst/sentry": "2.0.*",
"edvinaskrucas/notification": "1.*",
"laravelbook/ardent": "dev-master",
"orangehill/iseed": "dev-master",
"greggilbert/recaptcha": "dev-master",
"zizaco/factory-muff": "dev-master",
"mockery/mockery": "dev-master",
"way/phpunit-wrappers": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev"
}

Quick update. I've got it to work now. I had a few packages in my workbench directory which each had their own composer.json file. I had to update the require section to read:
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.*"
},

Related

Upgrade Laravel version from 5.2.45 to 5.4

I am working on an existing application and the application is in laravel framework(version 5.2.45).And now i have to upgrade it to the version(5.4).I have follow the upgrade version step from laravel official documentation. Below is the steps which i have done :
1) Update the version number in laravel composer.json file in "laravel/framework" key.
2) Then after run the command composer update.
3) After that during executing the command i face error and the solution of that is to add the below line in composer.json file.
"minimum-stability": "dev",
"prefer-stable": true,
4) Then after again i execute the command composer update.Now i am facing the issue which i have attached in the below image :
Here is the code of composer.json file :
{
"name": "ozdemirburak/laravel-5-simple-cms",
"description": "Simple Laravel 5 content management system for starters.",
"keywords": [
"framework",
"laravel",
"cms"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.4.*",
"laravelcollective/html": "5.2.*",
"baum/baum": "~1.1",
"kris/laravel-form-builder": "1.6.*",
"laracasts/flash": "~1.3",
"mews/purifier": "~2.0",
"cviebrock/eloquent-sluggable": "~3.1.4",
"barryvdh/laravel-elfinder": "0.3.*",
"spatie/laravel-analytics": "~1.1",
"yajra/laravel-datatables-oracle": "~6.0",
"pingpong/modules": "~2.1",
"caffeinated/menus": "~2.0",
"fisharebest/laravel-assets": "~1.0",
"caffeinated/themes": "2.0.5",
"teepluss/theme": "dev-master",
"roumen/sitemap": "2.6.*",
"maatwebsite/excel": "^2.1",
"intervention/image": "^2.3",
"laravel/socialite": "^2.0",
"xinax/laravel-gettext": "^3.1",
"omnipay/paypal": " *",
"mews/captcha": "^2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*",
"phpspec/phpspec": "~2.1",
"doctrine/dbal": "~2.5",
"squizlabs/php_codesniffer": "~1.5",
"laracasts/generators": "~1.1.3",
"barryvdh/laravel-ide-helper": "~2.0",
"barryvdh/laravel-debugbar": "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "modules/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"php artisan elfinder:publish"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist"
}
}
Note : For the current error i also found a solution in the stackoverflow and i implement that thing but still i am getting this error.
Thanks in advance!
You should update step by step, in your case update to 5.2 => 5.3 and after that 5.3 => 5.4 Please check laravel official documentation.
According to the error output:
"caffeinated/themes": "2.0.5" is locked to Laravel 5.1/5.2.
Upgrade that first.
Then the rest should follow.

Issue in php artisan config:clear in Laravel

I run php artisan config:clear or php artisan cache:clear or composer dump-autoload But show this error:
PHP Fatal error: Uncaught ReflectionException: Class App\Console\Kernel does not exist in
vendor/laravel/framework/src/Illuminate/Container/Container.php:767
Stack trace:
#0
vendor/laravel/framework/src/Illuminate/Container/Container.php(767): ReflectionClass->__construct('App\\Console\\Ker...')
#1
vendor/laravel/framework/src/Illuminate/Container/Container.php(646):
Illuminate\Container\Container->build('App\\Console\\Ker...')
#2
vendor/laravel/framework/src/Illuminate/Container/Container.php(601):
Illuminate\Container\Container->resolve('App\\Console\\Ker...', Array)
#3
vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734):
Illuminate\Container\Container->make('App\\Console\\Ker...', Array)
#4
vendor/laravel/framework/src/Illuminate/Container/Container.php(256):
Illuminate\Foundation\Appl in
vendor/laravel/framework/src/Illuminate/Container/Container.php on
line 767
Laravel version is 5.6
I run php artisan config:clear or php artisan cache:clear or composer dump-autoload.
Show this error after run php artisan config:clear
Update 1:
My Composer.json file is this code:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.3",
"bogardo/mailgun": "^5.0",
"cviebrock/eloquent-sluggable": "^4.5",
"fideloper/proxy": "~4.0",
"intervention/image": "^2.4",
"laravel/framework": "5.6.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.6",
"php-http/guzzle6-adapter": "^1.1",
"pusher/pusher-php-server": "^3.0",
"uxweb/sweet-alert": "^1.4"
},
"require-dev": {
"filp/whoops": "~2.0",
"nunomaduro/collision": "~1.1",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.0",
"symfony/thanks": "^1.0"
},
"aXutoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
This file is My composer.json.
How to issue this problem?
I got this same issue, to solve it delete the file config.php in bootstrap/cache, but if you run command php artisan config:cache,the same error will reappear
From Laravel doc
Laravel ^5.5
#php Blade Directive
The #php blade directive no longer accepts inline tags. Instead, use the full form of the directive:
#php
$teamMember = true;
#endphp
rename bootstrap/cache/config_old.php and also rename routes-v-old.php
i hope you got your solution .

Laravel: Update from 5.2.12 to 5.2.31

I have a Laravel 5.2.12 project (website), it's a big project and it's almost finished... Is there any simple way to update the Laravel from 5.2.12 to 5.2.31 without affecting the project (without affecting what was already done)? How can I do this?
So, the question is how to update the version of Laravel on existing project from 5.2.12 to 5.2.31?
EDIT: Here is my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"cartalyst/sentinel": "2.0.*",
"intervention/image": "^2.3",
"barryvdh/laravel-debugbar": "^2.2",
"slynova/laravel-commentable": "^2.0",
"barryvdh/laravel-ide-helper": "v2.2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
What should be changed to update just Laravel to 5.2.31 (to the latest 5.2 version)?
Update composer.json to use laravel\laravel on the version you would like. Then run composer update in you command line.
Your project should not have any issues updating from 5.2.12 to 5.2.31 since they are mostly bugfixes. But do note that other dependencies might update to a new version. So you might want to set them to a fixed version in your composer.json file if the cause hickups.

Laravel 5 composer update not working?

I am using Laravel version 5.2 and Jenssegers MongoDB. I installed both and working fine but I have to use any other library and made changes in composer.json after that use command composer update. After using this command automatically Jenssegers MongoDB file removed. I don't know why this happen. After composer update why Jenssegers MongoDB file removed automatically? Please suggest me how to handel this?
My composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"acacha/admin-lte-template-laravel": "2.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/common_helper.php"
]
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
Write this "jenssegers/mongodb": "*", line in your composer.json file:-
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"acacha/admin-lte-template-laravel": "2.*",
"jenssegers/mongodb": "*",
},
And add the service provider in config/app.php
Jenssegers\Mongodb\MongodbServiceProvider::class,
Jenssegers\Mongodb\Auth\PasswordResetServiceProvider,
then go to project root directory in terminal and run command composer update .
In model file, you need to add below line at the top,
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
Reference :- documentation
composer update --no-scripts
you can stop scripts run

Laravel composer update give error

I just update the compose and i found below error.
php artisan clear-compiled PHP Fatal error: Call to undefined method
Illuminate\View\Compilers\BladeCompiler::directive() in
/var/www/html/innomaid/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php
on line 213
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method
Illuminate\View\Compilers\BladeCompiler::directive()
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method
Illuminate\View\Compilers\BladeCompiler::directive() in
/var/www/html/innomaid/ve
ndor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on
line 213
Here is my composer code
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"illuminate/html": "5.*",
"barryvdh/laravel-dompdf": "0.6.*",
"tymon/jwt-auth": "0.5.*",
"gloudemans/shoppingcart": "~1.3",
"intervention/image": "^2.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"zizaco/entrust": "dev-laravel-5"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
Please help me to solve this error
update "zizaco/entrust": "dev-laravel-5" to "zizaco/entrust": "1.4.1"
Solve my problem.

Resources