Socket
Socket
Sign inDemoInstall

@awes-io/nuxt-laravel

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@awes-io/nuxt-laravel

Awes.io module for connection with Laravel backend


Version published
Maintainers
3
Created
Source

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

Keywords

FAQs

Package last updated on 16 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc