Skip to content

Commit ed57758

Browse files
committed
Invalidate routes cache
Clear the routes cache when a routes file is edited to ensure completion for route names is up to date.
1 parent fc70428 commit ed57758

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

autoload/laravel.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ call s:add_methods('cache', ['clear', 'get', 'set', 'has', 'needs'])
415415

416416
let s:app_prototype.cache = s:cache_prototype
417417

418+
augroup laravel_cache
419+
autocmd!
420+
autocmd BufWritePost routes.php,routes/*.php call laravel#cache_clear('routes')
421+
augroup END
422+
418423
""
419424
" Get namespace of buffer's file
420425
function! s:buffer_namespace() abort dict

0 commit comments

Comments
 (0)