Watson Sitemap Laravel Package – Causing Class does not exist issue when adding new page

I have the following laravel package to generate Google XML sitemaps: http://ift.tt/1Usl8cu

It’s setup like:


class SitemapsController extends Controller
{
public function all()
{
$pages = Page::where('active', '=', '1')->get();

foreach ($pages as $page) {
Sitemap::addTag(route('page.show', $page->slug), $page->updated_at, 'weekly', '0.8');
}

Sitemap::addTag(route('home'), date('Y-m-d'), 'weekly', '0.8');

return Sitemap::render();
}
}

So relatively simple. However every time a new page is added that should go onto the sitemap it gives me the following error:

[2022-01-05 07:53:25] local.ERROR: exception 'ReflectionException' with message 'Class AppHttpControllersSitemapsController does not exist' in /home/..../bootstrap/cache/compiled.php:1291

Thinking it was an issue with the package now downloading properly on composer, I did a composer update and there was an update for that package and it sorted it – however it’s happened again and I think it’s actually sorted when it regenerates the autoload files (which it does on a composer update). Any ideas how to sort this?

from Newest questions tagged laravel-5 – Stack Overflow http://ift.tt/1OIEagH
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.