• This repository has been archived on 13/Oct/2020
  • Stars
    star
    146
  • Rank 251,832 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build a SPA with Laravel and Nuxt.

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 JS

TravisCI Build status

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

I'm currently very busy so don't expect updates anytime soon. Please, check out m2sd/nuxt-laravel which is based on this repository but it's more active.

Installation

npm install laravel-nuxt

Attention! You must install the laravel-nuxt PHP package first.

Getting Started

Optionally, you will want to get rid of the default Laravel scaffolding.

Add a script to your package.json like this:

{
    "scripts": {
        "start": "laravel-nuxt"
    },
}

Wrap you nuxt.config.js's export with laravelNuxt:

const laravelNuxt = require("laravel-nuxt");

module.exports = laravelNuxt({
  // Your Nuxt options here...
  modules: [],
  plugins: [],

  // Options such as mode, srcDir and generate.dir are already handled for you.
});

Populate resources/nuxt/pages/index.vue inside your project:

<template>
  <h1>Hello {{ name }}!</h1>
</template>

<script>
export default {
  data: () => {
    return { name: 'world' };
  },
};
</script>

And then run:

npm start

Go to http://localhost:8000.

Commands

Development

laravel-nuxt dev

Starts both Nuxt and Laravel artisan servers in development mode (hot-module reloading, error reporting, etc).

Production

laravel-nuxt build

Compiles the application for production deployment.

This command will output the compiled assets in public/_nuxt.

Analysis

laravel-nuxt build -a

Launch webpack-bundle-analyzer to optimize your bundles.

Other

Getting rid of the default Laravel scaffolding

The default Laravel installation comes with some frontend files which are not needed anymore.

You can remove the following files and directories:

  • resources/assets/
  • package.json
  • package-lock.json
  • webpack.mix.js

More Repositories

1

potrace

[mirror] Tool for tracing a bitmap, which means, transforming a bitmap into a smooth, scalable image
Shell
229
star
2

laravel-nuxt

Build a SPA with Laravel and Nuxt.
PHP
123
star
3

clipper

[mirror] An open source freeware polygon clipping library
Pascal
84
star
4

RichText

Rich text class for SFML2. Allows the user to draw lines of text with different styles and colors.
C++
47
star
5

vue-jsx-hot-loader

Webpack loader for Vue.js v2 components with JSX render functions
JavaScript
41
star
6

psimpl

[mirror] Generic n-dimensional polyline simplification
C++
20
star
7

QxTimeLineEditor

Simple generic timeline editor for Qt
C++
10
star
8

props-to-local

Vue mixin that maps props to local data
JavaScript
7
star
9

aws-comsum-2023-introduction-to-wing

Slides and links for the AWS Comsum 2023 talk: Introduction to Wing
CWeb
6
star
10

QxClipper

Clipper wrapper class for Qt
C++
5
star
11

QxPotrace

Potrace wrapper class for Qt
C
5
star
12

query-syntax-php

Parse Algolia-like queries into sort of a AST.
PHP
4
star
13

jquery.iframe

jQuery plugin that creates inline iframes to isolate certain blocks of HTML
JavaScript
4
star
14

cloudy

Cloudy is a set of constructs for the AWS Cloud Development Kit that aim to improve the DX by providing a faster and type-safe code environment.
TypeScript
4
star
15

now

Vue mixin that generates a reactive time variable
JavaScript
2
star
16

linter-config

Linter Config Monorepo
JavaScript
2
star
17

animata

Mirror of animata
C++
2
star
18

QxMesh

2D mesh library for Qt
C++
2
star
19

gulp-less-watcher

(Not Maintained) Watches Less files (and imports) using an endless streaming interface (and generates sourcemaps)
JavaScript
2
star
20

jquery.promise

Lightweight promise implementation using jQuery.
JavaScript
2
star
21

linter-pug-lint

Atom linter plugin for Pug, using pug-lint.
JavaScript
2
star
22

makes-uuids

Mixin for Vue that generates UUIDs
JavaScript
2
star
23

cloudy-ts-eslint-plugin

ESLint plugin that provides a rule to enforce extensions on imports.
TypeScript
2
star
24

wingen

TypeScript
1
star
25

laravel-painless-legacy

Use some Laravel v5.3+ features in v5.2.
PHP
1
star
26

QxPSimpl

PSimpl wrapper class for Qt
C++
1
star
27

cloudy-docs

Documentation for Cloudy.
TypeScript
1
star
28

eslint-config-skyrpex

ESLint Shareable Config for JavaScript Style
JavaScript
1
star
29

QxPSimpl-2

C++
1
star
30

poi-preset-vue-jsx-hot-loader

Vue JSX hot loader's Poi preset
JavaScript
1
star
31

manifest-webpack-plugin

Creates an asset manifest
JavaScript
1
star
32

cloudy-node

TypeScript and ESM node runtime powered by esbuild.
TypeScript
1
star
33

QxPoly2Tri

Poly2Tri wrapper class for Qt
C++
1
star
34

gulp-webpack-sourcemaps

Wraps Webpack into a streaming interface (and generates sourcemaps)
JavaScript
1
star
35

cast-function

Casts value as a function if it's not one.
JavaScript
1
star