0

I have the following laravel package to generate Google XML sitemaps: https://github.com/dwightwatson/sitemap

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:

[2016-01-05 07:53:25] local.ERROR: exception 'ReflectionException' with message 'Class App\Http\Controllers\SitemapsController 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?

1 Answer 1

0

Have you tried php artisan clear-compiled? Removing the cached compiled.php may solve this issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.