Laravel hybrid SPA. It provides the functionality to load page state.
This package is meant to be used in conjunction withInstallation
npm install @mustafarefaey/laravel-hybrid-spa-page-state-loader
Usage
import { loadPageState } from '@mustafarefaey/laravel-hybrid-spa-page-state-loader';
After creating an instance of Vue router, add this navigation guard
router.beforeEach(async (to, from, next) => {
const pageStateLoaded = await loadPageState(
'__PAGE_STATE__',
to.fullPath,
(err) => console.error(err)
);
if (pageStateLoaded) {
next();
} else {
next(false);
}
});