You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you don't have any data in SeoManger table for the current URI, it throws an error of the object, because it is null, for that you need to just check if it is empty just return a blank string. I don't know how to submit the PR.
to fixed the problem just add this after $metaData = [];
if(empty($seoManager)){
return '';
}
The text was updated successfully, but these errors were encountered:
private function getMetaData($property) {
{
$route = \Route::current();
/*
* Add this check, I was getting an error "Call to a member function uri() on null"
* This was because it is a 404 page.
*/
if (empty($route)) {
return "Error";
}
$uri = $route->uri();
$seoManager = SeoManager::where('uri', $uri)->first();
if(is_null($seoManager)){
return null;
}
//............
}
When you don't have any data in SeoManger table for the current URI, it throws an error of the object, because it is null, for that you need to just check if it is empty just return a blank string. I don't know how to submit the PR.
to fixed the problem just add this after $metaData = [];
if(empty($seoManager)){
return '';
}
The text was updated successfully, but these errors were encountered: