Build a SPA with Laravel and Nuxt

1.4.0 2020-03-03 18:59 UTC

This package is auto-updated.

Last update: 2020-06-16 00:48:17 UTC


This package allows you to build a SPA with Laravel and Nuxt.


composer require pallares/laravel-nuxt

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

return [
  // ...
  'providers' => [
      // ...

You need to add a fallback route that will render the SPA page in routes/web.php file:

// ...
// Add this route the last, so it doesn't interfere with your other routes.
)->where('uri', '.*');

Finally, you must install the laravel-nuxt npm package. After following the instructions, run npm run build and try your SPA!