0.7.2 • Published 12 months ago

@awes-io/nuxt-laravel v0.7.2

Weekly downloads
117
License
MIT
Repository
github
Last release
12 months ago

Awes.io Module for Connection With Laravel Backend

Basic usage

Folders structure

\
-- app
-- bootstrap
-- config
-- ...other Laravel folders
-- resources /
---- nuxt
------ assets
------ components
------ ... other Nuxt folders
-- nuxt.config.js
-- package.json

Place Nuxt project into resources/nuxt folder, except nuxt.config.js and package.json. Place last mentioned files in the root of your project.

Follow next steps

  1. Ensure you have @awes-io/laravel-nuxt in your composer.json
  2. Install the module yarn add @awes-io/nuxt-laravel
  3. Modify nuxt.config.js
// nuxt.config.js

export default {
    mode: 'spa',

    srcDir: 'resources/nuxt',

    modules: [
        '@awes-io/nuxt-laravel' // include first
        // other nuxt modules
    ]
}
  1. Add scripts in your package.json
// package.json

{
    "scripts": {
        "dev": "LARAVEL_URL=http://path.to.dev.laravel nuxt",
        "build": "LARAVEL_URL=http://path.to.prod.laravel nuxt build",
        "generate": "LARAVEL_URL=http://path.to.prod.laravel nuxt generate",
        "start": "LARAVEL_URL=http://path.to.prod.laravel nuxt start"
    }
}
  1. All done!

How the module works

This module will do the next steps:

  1. Add @nuxtjs/axios module
  2. Proxy requests on /api/ route to your laravel backend
  3. Move built files to public path on nuxt generate command and create index.html for SPA entry point

Ensure to write proper commit message according to Git Commit convention

0.7.2

12 months ago

0.7.1

12 months ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.2

3 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago