laravel 5.4 sitemap error - php

I want to install this package in my project
https://github.com/spatie/laravel-sitemap
but the installation's failed. the error is
Anyone encountered this error. or their have other better package for laravel sitemap? any tutorial? thanks everyone :)

The error message is pretty clear. You're trying to install spatie/laravel-sitemap:^3.3, which requires laravel/framework:5.5 or higher. So you need to either upgrade to use Laravel 5.5, or use an older version of spatie/laravel-sitemap.
The Github repository lists the available releases. I would suggest looking at v2.4 as a starting point, as the ChangeLog for v3.0 mentions about adding Laravel 5.5 support.
composer require spatie/laravel-sitemap:2.4
Edit:
You asked where to put the generator code. It isn't something you're going to want to run on every request, so I would suggest creating a route dedicated to creating the sitemap.
// routes/web.php
Route::get('sitemap/generate', function () {
SitemapGenerator::create(base_url())->writeToFile($path);
});

Related

Laravel passport 7.5.1 - Replicating claims

We are having a new error related with laravel/passport: 7.5.1. Today, this library has been working as the last week. But this stops showing this message via Postman:
Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.
Do someone knows something about this issue?
We don't know how to continue with this...
We're using Laravel 5.7 (we know that...)
We "solved" this temporally downgrading the library lcobucci/jwt from 3.4.0 to 3.3.3.
help me in laravel 5.8
set in composer.json
"laravel/passport": "^7.5",
"lcobucci/jwt": "3.3.2",
and update vendor
composer update
For me downgrading, lcobucci/jwt worked for me. I was currently using 3.4.* but downgraded it to a constant 3.3.3
to downgrade I run the command
composer require lcobucci/jwt 3.3.3
And that was it. But my only concern is I am not certain if this is a temporary or a permanent solution to this issue. But at least it will reboot things up if your system failed cause of that error

I want install phpexcel laravel but phpexcel is abandoned

I want to install phpoffice/phpexcel in My Project.
When composer install or composer update, i receive error:
Package phpoffice/phpexcel is abandoned, you should avoid using it.
Use phpoffice/phpspreadsheet instead.
What is wrong with my project? Please help me. My project use PHP version 7.1.3 and Laravel version 5.7
It means the project is not being maintained. you can still use if you want to.
That message you are getting is just a warning, not an error so there is nothing wrong with your project. So you could ignore the warning and continue using the package with your current code.
However, as the message said you should avoid using it because the package might stop working properly if you decide to update laravel, php or any other dependencies. And if it does stop working or you encountered a bug, there will no code maintainer to help you solve your issue.
In your case, phpoffice/phpspreadsheet package actually provide a useful entry in their documentation to help you migrate to their package, so you should definitely give it a read as there are quite a few breaking changes if you decide to use their package.

Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found error after installing Laracast Generator in Laravel 5.4

I am getting this error after installing Laracast Generator plugin in Laravel 5.4.
Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found error
Now everytime when I try to run my project with php artisan serve this error starts coming.
I come to know from many posts that Laracast Generator plugin still does not support Laravel 5.4. If this is the case then how to completely remove this package from my project so that it will start working again.
Please see screenshot below for the error :-
Laracast Generator package issue
Please any one help me to solve the error
Some people have suggested to change the composer.json to :
"require": {
"laracasts/generators": "dev-master as 1.1.4"
},
check the issue on github
I simply fixed it replacing
use Illuminate\Console\AppNamespaceDetectorTrait;
by:
use Illuminate\Console\DetectsApplicationNamespace;
Good luck!

Laravel - Problems with updating to Laravel 5.4. Way module share() error

This is regarding Laravel and I am still pretty new to the framework. I recently updated my Laravel to 5.4. And I am running into the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Foundation\Application::share()
Some investigation landed me on one of my vendor module 'Way' is still call share(), which is no longer supported. I did realize that singleton() is the preferred way, but should I even touch the vendor files? Should composer update the vendor Modules as well (especially Way since it is one of the core module)?
Any tips will be greatly appreciated!
Thanks.
laravel 5.4 share has been removed. You will have to use the singleton instead.
See this
https://github.com/laravel/framework/commit/1a1969b6e6f793c3b2a479362641487ee9cbf736
I was able to fix it for now by adjusting the way generator line in composer.json to:
"way/generators": "dev-master"
The library was updated but it is just not included in the composer update.
Just want to post the answer here in case anyone is running into similar issue.
This library does not have support for Laravel 5.4 .
Author referred other library : laracasts/generators. Both the packages are managed by same author.
Check below link : https://github.com/JeffreyWay/Laravel-4-Generators#laravel-5

how to use wepay PHP sdk in laravel 5?

I want to use wepay PHP sdk in laravel 5 using composer but I didn't found any laravel package for it.
Can you please tell me me how can I do this?
The package is available via packagist.org - unfortunately only as a dev-master branch and with suboptimal autoloading configured (I'm trying to fix that, sent both a patch and opened an issue suggesting they tag their version).
Adding that package is basic Composer action. The classes should be automatically available within Laravel wherever you think you want to use it.

Categories