Skip to content
/ laranuxt Public template
forked from fumeapp/laranuxt

Laravel and Nuxt.js 3 boilerplate

Notifications You must be signed in to change notification settings

Nethh/laranuxt

This branch is 35 commits behind fumeapp/laranuxt:main.

Folders and files

NameName
Last commit message
Last commit date
Dec 8, 2022
Feb 27, 2023
Jul 28, 2021
Jan 31, 2023
Feb 21, 2023
Sep 10, 2020
Feb 28, 2023
May 6, 2022
Oct 5, 2022
Mar 1, 2022
Jun 22, 2022
Mar 1, 2022
Jan 31, 2023
Sep 10, 2020
Apr 19, 2023
Sep 10, 2020
Nov 5, 2021
Jan 31, 2023
Jan 31, 2023
Jan 7, 2022
Jun 20, 2020
Feb 21, 2023
Apr 19, 2023
Jan 9, 2023
Feb 27, 2023
Jun 22, 2022
Feb 21, 2023
Jun 22, 2022
Jan 9, 2023
Jun 22, 2022
Nov 20, 2021
Feb 27, 2023
Jan 31, 2023
Apr 19, 2023

Repository files navigation

Laravel + Nuxt.js Boilerplate

Now supporting Nuxt v3

MadeWithLaravel shield

Test PHP Lint Javascript Lint PHP

Examples on using Dark Mode, authentication, and listing data

What is included

  • NUXT v3 front end, a progressive Vue.js framework - For Nuxt v2 visit this branch

    • tailvue a collection of components built for Nuxt.js, powered by WindiCSS|TailwindCSS
    • Authentication library to assist with user sessions and logging in/out
    • Example Authentication Middleware
  • Laravel - for our API - v9.40.0

    • Model Typer - Generates Typescript interfaces from Laravel Models
    • MetAPI - API helpers and utilities
    • humble - Passwordless sessioning with detailed device and location
    • debugbar - awesome debugbar for our API
    • ide-helper - Helper files to enable help with IDE autocompletion

Installation

  • clone from GitHub
  • run yarn and composer install to install all of your deps
  • copy .env.example to .env and configure it to your likings
  • TL;DR
git clone git@github.com:fumeapp/laranuxt.git; cd laranuxt; yarn; composer install; cp .env.example .env;
  • Feel free to delete excess media in /resources/

Local Environment

  • run yarn dev in one terminal for our nuxt dev setup
  • run yarn api (alias for ./artisan serve) in another terminal for our laravel API

Api and Authentication

  • Api and auth can be accessed via the provided Api library
const api = useApi()
console.log(api.$user.name);

Authentication

  const redirect = await api.login(result)
  if (redirect) await router.push({path: redirect})
  • Once logged on, you have the boolean api.loggedIn and the object api.$user
  <img class="w-8 h-8 rounded-full bg-blue-400" :src="api.$user.avatar" alt="User Avatar">

API

The API class provides helper functions to easily retrieve, update, and remove data from your Laravel endpoints. If you use and update modeltyper regularly you will always have completely typed results

  • To get a listing/index of data, use api.index
const users = api.index<models.UserResults>('/user', { page: 1 })
  • To get an individual by id, use api.get
const users = api.get<models.User>('/user/1')
  • To update with an id, use api.put
const result = api.put<api.MetapiResponse>('/user/1', user)
  • To store a new record, use api.store
const result = api.store<api.MetApiResponse>('/user', { name: 'Bob', email: 'bob@mail.com' })
  • To delete with an id, use api.delete
const result = api.delete<api.MetApiResponse>('/user/1')

About

Laravel and Nuxt.js 3 boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 64.7%
  • Vue 20.6%
  • TypeScript 10.6%
  • Dockerfile 1.7%
  • CSS 1.0%
  • Shell 0.9%
  • Other 0.5%