{"id":30496089,"url":"https://github.com/k2so-dev/laravel-nuxt","last_synced_at":"2025-08-25T01:05:11.469Z","repository":{"id":208665134,"uuid":"718640833","full_name":"k2so-dev/laravel-nuxt","owner":"k2so-dev","description":"Laravel and Nuxt.js boilerplate designed for development with maximum API performance, ready-made authorization methods, image uploading with optimization, user roles, device management","archived":false,"fork":false,"pushed_at":"2025-07-19T15:48:53.000Z","size":2864,"stargazers_count":291,"open_issues_count":1,"forks_count":57,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-07-19T16:16:34.619Z","etag":null,"topics":["boilerplate","breeze","jetstream","laravel","laravel-boilerplate","laravel-nuxt","laravel-sanctum","laravel-vue","laravel11","nuxt","nuxt-boilerplate","nuxt-ui","nuxt3","sanctum","sanctum-authentication","starter-kit","tailwindcss","vue","vue-ssr","vue3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k2so-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-14T14:01:21.000Z","updated_at":"2025-07-19T12:40:33.000Z","dependencies_parsed_at":"2024-01-29T12:47:50.380Z","dependency_job_id":"71447766-606e-4b40-9baf-b64b764c0c88","html_url":"https://github.com/k2so-dev/laravel-nuxt","commit_stats":null,"previous_names":["k2so-dev/laravel-nuxt"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/k2so-dev/laravel-nuxt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k2so-dev%2Flaravel-nuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k2so-dev%2Flaravel-nuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k2so-dev%2Flaravel-nuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k2so-dev%2Flaravel-nuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k2so-dev","download_url":"https://codeload.github.com/k2so-dev/laravel-nuxt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k2so-dev%2Flaravel-nuxt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271989743,"owners_count":24854702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","breeze","jetstream","laravel","laravel-boilerplate","laravel-nuxt","laravel-sanctum","laravel-vue","laravel11","nuxt","nuxt-boilerplate","nuxt-ui","nuxt3","sanctum","sanctum-authentication","starter-kit","tailwindcss","vue","vue-ssr","vue3"],"created_at":"2025-08-25T01:05:04.258Z","updated_at":"2025-08-25T01:05:11.462Z","avatar_url":"https://github.com/k2so-dev.png","language":"PHP","funding_links":[],"categories":["Starter Kits"],"sub_categories":[],"readme":"![preview](https://github.com/user-attachments/assets/08c7f1f5-9828-4a33-986a-7c70444b0ac6)\n\n# Laravel Nuxt Boilerplate\n\n[![](https://img.shields.io/badge/Laravel-v12-ff2e21.svg)](https://laravel.com)\n[![](https://img.shields.io/badge/nuxt.js-v4-04C690.svg)](https://nuxt.com)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fk2so-dev%2Flaravel-nuxt.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fk2so-dev%2Flaravel-nuxt?ref=badge_shield)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/k2so-dev/laravel-nuxt/laravel.yml)](https://github.com/k2so-dev/laravel-nuxt/actions/workflows/laravel.yml)\n[![CodeQL](https://github.com/k2so-dev/laravel-nuxt/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/k2so-dev/laravel-nuxt/actions/workflows/github-code-scanning/codeql)\n\nThe goal of the project is to create a template for development on Laravel and Nuxt with maximum API performance, ready-made authorization methods, image uploading with optimization and ready-made user roles.\n\n\u003c!-- TOC --\u003e\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n    - [Standalone](#standalone)\n    - [Docker Deploy (Laravel Sail)](#docker-deploy-laravel-sail)\n    - [Auth Guard Switch](#auth-guard-switch)\n- [Upgrade](#upgrade)\n- [Usage](#usage)\n    - [Fetch wrapper](#fetch-wrapper)\n    - [Authentication](#authentication)\n    - [Nuxt Middleware](#nuxt-middleware)\n    - [Laravel Middleware](#laravel-middleware)\n- [Examples](#examples)\n    - [Route list](#route-list)\n    - [Demo](#demo)\n- [Links](#links)\n- [License](#license)\n\n\u003c!-- /TOC --\u003e\n\n## Features\n\n - [**Laravel 12**](https://laravel.com/docs/12.x) and [**Nuxt 4**](https://nuxt.com/)\n - [**Laravel Octane**](https://laravel.com/docs/12.x/octane) supercharges your application's performance by serving your application using high-powered application servers.\n - [**Laravel Telescope**](https://laravel.com/docs/12.x/telescope) provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more.\n - [**Laravel Sanctum**](https://laravel.com/docs/12.x/sanctum) Token/Session-based authorization is compatible with **SSR** and **CSR**\n - [**Laravel Socialite**](https://laravel.com/docs/12.x/socialite) OAuth providers\n - [**Laravel Sail**](https://laravel.com/docs/12.x/sail) Light-weight command-line interface for interacting with Laravel's default Docker development environment.\n - [**Spatie Laravel Permissions**](https://spatie.be/docs/laravel-permission/v6/introduction) This package allows you to manage user permissions and roles in a database.\n - UI library [**Nuxt UI 3**](https://ui.nuxt.com/) based on [**TailwindCSS 4**](https://tailwindcss.com/) and [**Reka UI**](https://reka-ui.com/).\n - [**Pinia**](https://pinia.vuejs.org/ssr/nuxt.html) The intuitive store for Vue.js\n - Integrated pages: login, registration, password recovery, email confirmation, account information update, password change.\n - Temporary uploads with cropping and optimization of images.\n - Device management\n - Enhanced Fetch Wrappers : Utilizes `$http` and `useHttp`, which extend the capabilities of **Nuxt's** standard `$fetch` and `useFetch`.\n\n## Requirements\n\n - PHP 8.3+ / Node 20+\n - **Redis** is required for the [**Throttling with Redis**](https://laravel.com/docs/12.x/routing#throttling-with-redis) feature\n - [**Laravel Octane**](https://laravel.com/docs/12.x/octane) supports 3 operating modes: Swoole (php extension), Roadrunner and FrankenPHP\n\n## Installation\n### Standalone\n1. `composer install \u0026\u0026 bun install`\n2. `cp .env.example .env \u0026\u0026 php artisan key:generate \u0026\u0026 php artisan storage:link`\n3. `php artisan migrate \u0026\u0026 php artisan db:seed`\n4. `php artisan octane:install`\n5. `php artisan octane:start --watch --port=8000 --host=127.0.0.1`\n6. `bun dev`\n\n### Docker Deploy (Laravel Sail)\n[Laravel Sail](https://laravel.com/docs/12.x/sail) is a light-weight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.\n\nAt its heart, Sail is the `docker-compose.yml` file and the `sail` script that is stored at the root of your project. The sail script provides a CLI with convenient methods for interacting with the Docker containers defined by the docker-compose.yml file.\n\nLaravel Sail is supported on macOS, Linux, and Windows (via [WSL2](https://docs.microsoft.com/en-us/windows/wsl/about)).\n1. Installing Composer Dependencies\n```shell\ndocker run --rm \\\n    -u \"$(id -u):$(id -g)\" \\\n    -v \"$(pwd):/var/www/html\" \\\n    -w /var/www/html \\\n    laravelsail/php84-composer:latest \\\n    composer install --ignore-platform-reqs\n```\n2. Configuring A Shell Alias (Optional)\n```shell\nalias sail='sh $([ -f sail ] \u0026\u0026 echo sail || echo vendor/bin/sail)'\n```\nTo make sure this is always available, you may add this to your shell configuration file in your home directory, such as ~/.zshrc or ~/.bashrc, and then restart your shell.\n\n3. `sail up`\n4. `sail bun install`\n5. `sail bun dev`\n\n\u003e Read the full [Laravel Sail](https://laravel.com/docs/12.x/sail) documentation to get the best user experience\n\n### Auth Guard Switch\n\nYou can switch the authentication guard between **Token** and **Session** using the following command:\n\n```shell\nphp artisan auth:switch\n```\n\n## Upgrade\n\nStandalone:\n```shell\nnpx nuxi upgrade\ncomposer update\n```\n\nSail:\n```shell\nsail npx nuxi upgrade\nsail composer update\n```\n\n## Usage\n\n### Fetch wrapper\n\nTo integrate with the API, enhanced `$http` and `useHttp` wrappers are used, expanding the functionality of Nuxt's standard `$fetch` and `useFetch`. The `$http` wrapper includes custom interceptors to replace the originals:\n- `onFetch` instead of `onRequest`\n- `onFetchError` instead of `onRequestError`\n- `onFetchResponse` instead of `onResponse`\n- `onFetchResponseError` instead of `onResponseError`\n\nAdditionally, `$http` predefines a base url, authorization headers, and proxy IP for convenient API work in SSR mode.\nFor example, the code for authorizing a user by email and password:\n```vue\n\u003cscript lang=\"ts\" setup\u003e\nconst router = useRouter();\nconst auth = useAuthStore();\nconst form = templateRef(\"form\");\nconst state = reactive({\n  email: \"\",\n  password: \"\",\n  remember: false,\n});\n\nconst { refresh: onSubmit, status } = useHttp(\"login\", {\n  method: \"POST\",\n  body: state,\n  immediate: false,\n  watch: false,\n  async onFetchResponse({ response }) {\n    if (response?.status === 422) {\n      form.value.setErrors(response._data?.errors);\n    } else if (response._data?.ok) {\n      await auth.login(response._data.token ?? null);\n      await router.push(\"/\");\n    }\n  }\n});\n\nconst loading = computed(() =\u003e status.value === \"pending\");\n\u003c/script\u003e\n\u003ctemplate\u003e\n  \u003cUForm ref=\"form\" :state=\"state\" @submit=\"onSubmit\" class=\"space-y-4\"\u003e\n    \u003cUFormField label=\"Email\" name=\"email\" required\u003e\n      \u003cUInput\n        v-model=\"state.email\"\n        placeholder=\"you@example.com\"\n        icon=\"i-heroicons-envelope\"\n        trailing\n        type=\"email\"\n        autofocus\n      /\u003e\n    \u003c/UFormField\u003e\n\n    \u003cUFormField label=\"Password\" name=\"password\" required\u003e\n      \u003cUInput v-model=\"state.password\" class=\"w-full\" type=\"password\" /\u003e\n    \u003c/UFormField\u003e\n\n    \u003cUTooltip :delay-duration=\"0\" text=\"for 1 month\" :content=\"{ side: 'right' }\"\u003e\n      \u003cUCheckbox v-model=\"state.remember\" class=\"w-full\" label=\"Remember me\" /\u003e\n    \u003c/UTooltip\u003e\n\n    \u003cdiv class=\"flex items-center justify-end space-x-4\"\u003e\n      \u003cNuxtLink class=\"text-sm\" to=\"/auth/forgot\"\u003eForgot your password?\u003c/NuxtLink\u003e\n      \u003cUButton type=\"submit\" label=\"Login\" :loading=\"loading\" /\u003e\n    \u003c/div\u003e\n  \u003c/UForm\u003e\n\u003c/template\u003e\n```\n\u003e In this example, a POST request will be made to the url **\"/api/v1/login\"**\n\n### Authentication\n**useAuthStore()** has everything you need to work with authorization.\n\nData returned by **useAuthStore**:\n* `logged`: Boolean, whether the user is authorized\n* `user`: User object, user stored in pinia store\n* `fetchCsrf`: Function, fetch csrf token\n* `fetchUser`: Function, fetch user data\n* `login`: Function, login user by token/session\n* `logout`: Function, remove local data and call API to remove token/session\n* `hasRole`: Function, checks the role\n\n### Nuxt Middleware\n\nThe following middleware is supported:\n* `guest`: unauthorized users\n* `auth`: authorized users\n* `verified`: users who have confirmed their email\n* `role-user`: users with the 'user' role\n* `role-admin`: users with the 'admin' role\n\n### Laravel Middleware\n\nAll built-in middleware from Laravel + middleware based on roles [**Spatie Laravel Permissions Middleware**](https://spatie.be/docs/laravel-permission/v6/basic-usage/middleware)\n\n## Examples\n\n### Route list\n\n![routes](https://github.com/k2so-dev/laravel-nuxt/assets/15279423/39bb3021-a4d1-4472-8320-5a397809904d)\n\n### Demo\n\nhttps://github.com/k2so-dev/laravel-nuxt/assets/15279423/9b134491-1444-4323-a7a3-d87833dcdc67\n\n## Links\n* [Nuxt 4](https://nuxt.com/)\n* [Nuxt UI 3](https://ui.nuxt.com/)\n* [Tailwind CSS 4](https://tailwindcss.com/)\n* [Laravel 12x](https://laravel.com/docs/12.x)\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fk2so-dev%2Flaravel-nuxt.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fk2so-dev%2Flaravel-nuxt?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk2so-dev%2Flaravel-nuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk2so-dev%2Flaravel-nuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk2so-dev%2Flaravel-nuxt/lists"}