Skip to content

Deprecated features and undefined variable #18

Open
@binkapS

Description

@binkapS

PHP Deprecated: Melbahja\Seo\Sitemap::__construct(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in /home/gamerighq/htdocs/gamerighq.com/vendor/melbahja/seo/src/Sitemap.php on line 52
PHP Deprecated: Melbahja\Seo\Interfaces\SitemapIndexInterface::__construct(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in
vendor/melbahja/seo/src/Interfaces/SitemapIndexInterface.php on line 13

In Sitemap.php line 200:

Undefined variable $name

Activity

melbahja

melbahja commented on Jun 3, 2025

@melbahja
Owner

can you provide code to reproduce it ?

binkapS

binkapS commented on Jun 3, 2025

@binkapS
Author
$sitemap = new Sitemap(config('app.url'), ['save_path' => public_path('sitemap')]);
        $sitemap->links(['name' => 'categories.xml', 'images' => false], function ($map) {
            Category::all()->each(function ($category) use ($map) {
                $map->loc("/category/{$category->slug}")
                    ->freq('weekly')->priority('0.9')
                    ->lastMod($category->updated_at->toDateString());
            });
        });
 $sitemap->save();

It's a laravel project
The category class is a Model
PHP Version Info:

PHP 8.4.5 (cli) (built: Mar 17 2025 20:35:32) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.5, Copyright (c), by Zend Technologies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @melbahja@binkapS

        Issue actions

          Deprecated features and undefined variable · Issue #18 · melbahja/seo