Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.
/ laravel-nuxt Public archive

Build a SPA with Laravel and Nuxt.

License

Notifications You must be signed in to change notification settings

skyrpex/laravel-nuxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning: this project has been deprecated

laravel-nuxt was created to offer some sugar when working locally with Laravel+Nuxt, solving some cookie problems in the process. Today, it isn't necessary anymore.

We recommend using Laravel Sanctum, which plays nicely with SPAs (see Sanctum's SPA Authentication section). If you can't migrate, just keep using laravel-nuxt.

Laravel Nuxt

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

Installation

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' => [
      // ...
      Pallares\LaravelNuxt\LaravelNuxtServiceProvider::class,
  ],
];

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.
Route::get(
    '{uri}',
    '\\'.Pallares\LaravelNuxt\Controllers\NuxtController::class
)->where('uri', '.*');

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

About

Build a SPA with Laravel and Nuxt.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages