Laravel似乎是缓存错误?

So I just had an error on laravel.

Call to a member function getName() on null

I was running this code

view()->composer('*', function ($view)
{
    $view->with('route_name', ucfirst(explode(".", \Route::current()->getName())[1]));
});

This code only broke in the first place on one of my pages, a newly added route. The pages that it worked on seem to be caching whatever was there before, I even made the second argument "test".

It seems to be caching the error when I've replaced the code? But only showing the error on the page it showed it, to begin with.