Closed kskrlin closed 5 years ago
Please Share your package and controller configuration
Version: "artesaos/seotools": "^0.10.0",
$this->seo()->setTitle($page->title)->setDescription($page->meta_description); SEOMeta::setKeywords($page->meta_keywords);
'defaults' => [ 'title' => config('app.name'), 'description' => '', 'separator' => ' | ', 'keywords' => [], 'canonical' => null, ],
Local server outputs News | AppName, live server outputs just News
It seems like there is no problem with your configuration! Could you please check if your .env of your live environment has a key APP_NAME
?
No, there is no APP_NAME in my env file, but I don't use it anywhere also, I use name from config/app.php file
So, locally this works:
'defaults' => [ 'title' => config('app.name'), // set false to total remove 'description' => '', // set false to total remove 'separator' => ' | ', 'keywords' => [], 'canonical' => null, // Set null for using Url::current(), set false to total remove ],
and on the server it breaks, title from defaults is null
but when I use this configuration on server
'defaults' => [ 'title' => env('APP_NAME'), // set false to total remove 'description' => '', // set false to total remove 'separator' => ' | ', 'keywords' => [], 'canonical' => null, // Set null for using Url::current(), set false to total remove ],
it works...
I don't want to put my app name inside env, I want to keep it inside my config.app file.
What can be causing this issue, when local server doesn't produce it? And I tried it on 2 local servers, 1 custom installed on Ubuntu and 1 on Windows using wamp. Also the package is used on 2 different projects which are hosted by 2 different servers, so I don't think the bug is caused by the server configuration.
On local server if there is no title set through this package, title is created with the default name from config file, however on live server the default title is ignored.
Also on localhost every title set through the package has the default name included after the main title separated with the separator, but on live server this is also ignored.