How to implemented breadcrums in laravel 5.3? - laravel

i have in trouble in using breadcrumbs for laravel,i using laravel 5.3 and when i install the package, it always fail and display error message like in the picture
If you have solution i do hope you can share to me...
Thanks

Try to install v5.1.1
composer require davejamesmiller/laravel-breadcrumbs:5.1.1

Here are the requirements to run composer require davejamesmiller/laravel-breadcrumbs:5.1.2
"require": {
"php": ">=7.1.3",
"illuminate/support: 5.6.*",
"illuminate/view: 5.6.*,
"laravel/framework": "5.6.*"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
Add this to your composer.json. Hope it helps

Related

php 8.2 + laravel 9 failed with composer error that cron-expression does not match the constraint

I am updating laravel to use php 8.2, according to laravel document here, using "laravel/framework": "^9.43" should be enough.
My composer.json are the following,
"require": {
"php": "^8.2",
"clue/socket-raw": "^1.3",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"gregwar/captcha": "1.*",
"guzzlehttp/guzzle": "^7.0.1",
"itsgoingd/clockwork": "^5.1",
"jacobcyl/ali-oss-storage": "^2.0",
"james-heinrich/getid3": "^1.9",
"laravel/framework": "^9.43",
"laravel/horizon": "^5.7",
"laravel/tinker": "^2.5",
"php-curl-class/php-curl-class": "^8.6"
},
But when running composer install --no-scripts --no-autoloader --no-dev (I don't use composer.lock here), composer complained,
laravel/framework[v9.43.0, ..., 9.x-dev] require dragonmantank/cron-expression ^3.3.2 -> found
dragonmantank/cron-expression[dev-set-up-semaphore,
dev-update-v3-php8, dev-master, dev-issue/35-fix-and-or-problem,
dev-allow-phpstan-failures, v1.0.0, ..., v1.2.1, v2.0.0, ...,
v2.3.1.x-dev, v3.0.0, ..., v3.3.1] but it does not match the
constraint.
I know laravel/framework 9 requires cron-expression ^3.3.2 as https://packagist.org/packages/laravel/framework said. But I can't figure out which other package requires a different version of cron-expression. I search the old composer.lock (which I don't use when install) I find multi-mention of dev-master, but no [dev-set-up-semaphore, dev-update-v3-php8, dev-issue/35-fix-and-or-problem, dev-allow-phpstan-failures]
Please check the following build log
How do I find that package ? BTW, php 8.1.7 + "laravel/framework" 8 works fine.
--- update ---
I find the reason why composer complains.
I have "require-dev" in my composer and all packages in it use the latest versions! I also check https://packagist.org/ to make sure they all say they support ^8.0. Besides, my command is composer install --no-scripts --no-autoloader --no-dev, no-dev !
So I didn't expect "require-dev" will cause problem. But only after I remove the "require-dev" did composer run successfully!
Apparently one of those packages do not support php 8.2 yet.
"require-dev": {
"facade/ignition": "^2.17",
"fakerphp/faker": "^1.21.0",
"laravel/sail": "^1.18.1",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^6.4",
"phpunit/phpunit": "^9.5.28"
}
After removing "facade/ignition" from "require-dev", composer finally works!
As for why does "facade/ignition" cause the problem and what is the solution for it, please refer to #NicoHaase's answer and my discussion with him.
"Apparently one of those packages do not support php 8.2 yet." - no, that's not the cause. Ignition does not support Laravel v9, as written in their readme:
If you're on Laravel 8 or above, you can switch to spatie/laravel-ignition, which is a drop-in replacement. Replace facade/ignition with "spatie/laravel-ignition": "^1.0" in your application's composer.json file.
Going forward, we'll only add security fixes to facade/ignition and highly encourage you to switch to spatie/laravel-ignition.
Use composer's why-not command:
composer why-not laravel/framework 9.43

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.

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.

How not upgrade to Laravel 5.4 when I run composer update

How can I Prevent my application from upgrading to Laravel 5.4 when I run composer update.
Thanks for any assistance.
Simply edit your project's composer.json and set exact version for laravel/laravel component you want to keep, i.e.:
"require": {
"laravel/framework": "5.3.29",
...
},
Alternatively, if you want still to have automatic updates for your current version you can use * (and this is constrain which Laravel uses too):
"require": {
"laravel/framework": "5.3.*",
...
},
See docs on how Composer versions are handled.
If unsure what version of Laravel you are using now, list it with composer:
composer show laravel/*
If you want to work on dev branch of the 5.3 version you should change dependency in your Laravel's composer.json:
"require": {
...
"laravel/framework": "5.3.*#dev",
...
},
where #dev points the development feature branch of 5.3.*.
Inside your composer.json file:
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*"
- your other packages here -
},
Make sure the "laravel/framework": "5.3.*" line is set to version 5.3.* instead of 5.4.*

Resources