artesaos / seotools

SEO Tools for Laravel
MIT License
3.07k stars 503 forks source link

After vender publish, got a php artisan error #144

Closed ghost closed 5 years ago

ghost commented 5 years ago

After I created the config file with php artisan vendor:publish --provider="Artesaos\SEOTools\Providers\SEOToolsServiceProvider". I got a error when I run 'php artisan'

Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /Users/jurdekker/Desktop/Project/image-co mpressor/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 62

When i delete the config it work perfectly.

This is the config file:

<?php

return [
    'meta'      => [
        /*
         * The default configurations to be used by the meta generator.
         */
        'defaults'       => [
            'title'        => config('app.name', 'Laravel'), // set false to total remove
            'description'  => 'Optimize and compress your images online.', // set false to total remove
            'separator'    => ' - ',
            'keywords'     => [],
            'canonical'    => false, // Set null for using Url::current(), set false to total remove
            'robots'       => false, // Set to 'all', 'none' or any combination of index/noindex and follow/nofollow
        ],

        /*
         * Webmaster tags are always added.
         */
        'webmaster_tags' => [
            'google'    => null,
            'bing'      => null,
            'alexa'     => null,
            'pinterest' => null,
            'yandex'    => null,
        ],
    ],
    'opengraph' => [
        /*
         * The default configurations to be used by the opengraph generator.
         */
        'defaults' => [
            'title'       => config('app.name', 'Laravel'), // set false to total remove
            'description' => 'Optimize and compress your images online.', // set false to total remove
            'url'         => null, // Set null for using Url::current(), set false to total remove
            'type'        => false,
            'site_name'   => config('app.name', 'Laravel'),
            'images'      => [asset('favicon.ico')],
        ],
    ],
    'twitter' => [
        /*
         * The default values to be used by the twitter cards generator.
         */
        'defaults' => [
          //'card'        => 'summary',
          //'site'        => '@LuizVinicius73',
        ],
    ],
];
peterangelov commented 5 years ago

Try removing calling of asset() helper function. This is not part of the original config file (see https://github.com/artesaos/seotools/blob/master/src/resources/config/seotools.php)

ghost commented 5 years ago

Thanks