Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f9b8d67
streamlined dark mode
connorabbas Dec 31, 2024
856d9bd
Merge pull request #94 from connorabbas/develop
connorabbas Dec 31, 2024
7689bbe
set dark mode auto
connorabbas Dec 31, 2024
c5afb08
provide/inject
connorabbas Dec 31, 2024
439cd70
Merge pull request #98 from connorabbas/develop
connorabbas Dec 31, 2024
c5a21ad
default filters fix
connorabbas Jan 7, 2025
bdcbbc8
TS
connorabbas Jan 11, 2025
e2bb615
fixes/cleanup, github actions
connorabbas Jan 11, 2025
69f63fa
pipeline
connorabbas Jan 11, 2025
5278e4d
pipeline, again
connorabbas Jan 11, 2025
01e6fb1
...
connorabbas Jan 11, 2025
5390433
...
connorabbas Jan 11, 2025
652ce65
...
connorabbas Jan 11, 2025
d5d2a90
...
connorabbas Jan 11, 2025
b3a296c
eslint
connorabbas Jan 11, 2025
0114e23
lint
connorabbas Jan 11, 2025
bb1c839
more linting
connorabbas Jan 11, 2025
e3917fe
more linting
connorabbas Jan 11, 2025
c51e343
linting
connorabbas Jan 11, 2025
5575683
last fix?...
connorabbas Jan 11, 2025
46824a7
readme, ignore
connorabbas Jan 11, 2025
58db71d
ignore build path
connorabbas Jan 11, 2025
ef8054c
pint
connorabbas Jan 11, 2025
3884a84
pint fix
connorabbas Jan 11, 2025
b949c34
test pint
connorabbas Jan 11, 2025
8229946
pint
connorabbas Jan 11, 2025
cc1024d
pint test
connorabbas Jan 11, 2025
eee3da9
pint fixes
connorabbas Jan 11, 2025
cf0d450
Merge pull request #102 from connorabbas/develop
connorabbas Jan 11, 2025
9c01782
run all on pull requests
connorabbas Jan 11, 2025
cc11cd3
Merge pull request #104 from connorabbas/develop
connorabbas Jan 11, 2025
7a726ec
additional devcontainer extensions
connorabbas Jan 11, 2025
9815669
Merge pull request #107 from connorabbas/develop
connorabbas Jan 11, 2025
ad6ee6a
composable fix
connorabbas Jan 11, 2025
732c9e1
Merge pull request #110 from connorabbas/develop
connorabbas Jan 11, 2025
0d28f8a
fix again...
connorabbas Jan 11, 2025
4b763df
Merge pull request #113 from connorabbas/develop
connorabbas Jan 11, 2025
873b388
composable fixes
connorabbas Jan 12, 2025
8d8c9f2
Merge pull request #117 from connorabbas/develop
connorabbas Jan 12, 2025
d8d0762
Fixes
connorabbas Jan 13, 2025
f51c929
cleanup
connorabbas Jan 14, 2025
f3543c8
Merge branch 'develop' of github.com:connorabbas/laravel-inertia-prim…
connorabbas Jan 14, 2025
a9d4106
name change
connorabbas Jan 14, 2025
e5bcece
global components
connorabbas Jan 14, 2025
498cd80
Merge pull request #120 from connorabbas/develop
connorabbas Jan 14, 2025
8c6354e
Cleanup
connorabbas Jan 14, 2025
8ed33c7
Merge pull request #123 from connorabbas/develop
connorabbas Jan 14, 2025
7d006d5
readme
connorabbas Jan 14, 2025
d4b9171
Merge pull request #126 from connorabbas/develop
connorabbas Jan 14, 2025
47dabd9
reset matchmode
connorabbas Jan 14, 2025
5902ff3
Merge pull request #127 from connorabbas/develop
connorabbas Jan 15, 2025
49290f8
composable sorting fix
connorabbas Jan 15, 2025
5c6ba76
Merge pull request #130 from connorabbas/develop
connorabbas Jan 16, 2025
b77d948
fix for vite 6 + https
connorabbas Jan 24, 2025
55798d4
vite 6
connorabbas Jan 24, 2025
31a5504
tailwind v4
connorabbas Jan 24, 2025
03c7228
remove postcss
connorabbas Jan 24, 2025
d91d189
file naming
connorabbas Jan 25, 2025
5139193
Merge pull request #133 from connorabbas/develop
connorabbas Jan 25, 2025
8757e2e
formatting
connorabbas Jan 28, 2025
4b9f748
Link component formatting fix
connorabbas Jan 28, 2025
505b73c
lint rule for wrapping pt attributes
connorabbas Jan 28, 2025
abf8662
test
connorabbas Jan 28, 2025
84bb931
...
connorabbas Jan 28, 2025
ac9764b
...
connorabbas Jan 28, 2025
7fcc24a
Merge pull request #137 from connorabbas/develop
connorabbas Jan 28, 2025
1cf2bf4
Head fix
connorabbas Jan 28, 2025
91e6fa9
Merge pull request #138 from connorabbas/develop
connorabbas Jan 28, 2025
e8caaeb
composable fixes
connorabbas Jan 28, 2025
a552f81
Merge pull request #141 from connorabbas/develop
connorabbas Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@
"esbenp.prettier-vscode",
"mikestead.dotenv",
"streetsidesoftware.code-spell-checker",
"shd101wyy.markdown-preview-enhanced"
"shd101wyy.markdown-preview-enhanced",
"formulahendry.auto-rename-tag",
"pmneo.tsimporter"
],
"settings": {}
"settings": {
"html.format.wrapAttributes": "force-expand-multiline",
"[vue]": {
"editor.defaultFormatter": "Vue.volar",
"editor.tabSize": 4
}
}
}
},
"remoteUser": "sail",
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Laravel CI

on:
push:
branches: [ "master" ]
pull_request:

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

laravel:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.3'
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, json, libxml, zip

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: Install PHP Dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run Pint
run: vendor/bin/pint --test

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'

- name: Install Node Dependencies
run: npm ci

- name: Build Frontend Assets
run: npm run build

- name: Set Environment Variables
run: |
echo "APP_ENV=testing" >> .env
echo "DB_CONNECTION=sqlite" >> .env
echo "DB_DATABASE=database/database.sqlite" >> .env

- name: Generate Application Key
run: php artisan key:generate

- name: Prepare Database
run: |
mkdir -p database
touch database/database.sqlite

- name: Migrate Database
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate:fresh --force

- name: Run Tests
env:
APP_ENV: testing
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
components.d.ts
/.fleet
/.idea
/.vscode
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
# Laravel, Inertia.js, & PrimeVue Starter Kit

## About
![Static Badge](https://img.shields.io/badge/Laravel%20-%20v11%20-%20%23f9322c) ![Static Badge](https://img.shields.io/badge/Inertia.js%20-%20v2%20-%20%236b46c1) ![Static Badge](https://img.shields.io/badge/Vue.js%20-%20v3.5%20-%20rgb(66%20184%20131)) ![Static Badge](https://img.shields.io/badge/PrimeVue%20-%20v4%20-%20rgb(16%20185%20129))

![Static Badge](https://img.shields.io/badge/Laravel%20-%20v11%20-%20%23f9322c) ![Static Badge](https://img.shields.io/badge/Inertia.js%20-%20v2%20-%20%236b46c1) ![Static Badge](<https://img.shields.io/badge/Vue.js%20-%20v3.5%20-%20rgb(66%20184%20131)>) ![Static Badge](https://img.shields.io/badge/PrimeVue%20-%20v4%20-%20rgb(16%20185%20129)) ![Static Badge](https://img.shields.io/badge/Tailwind%20CSS%20-%20v4%20-%20%230284c7)


A basic authentication starter kit using [Laravel](https://laravel.com/docs/master), [Intertia.js](https://inertiajs.com/), and [PrimeVue](https://primevue.org/). An equivalent to using [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze), but with the added benefit of all the PrimeVue components at your disposal.
A basic authentication starter kit using [Laravel](https://laravel.com/docs/master), [Intertia.js](https://inertiajs.com/), [PrimeVue](https://primevue.org/) components, and [Tailwind CSS](https://tailwindcss.com/). An equivalent to using [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze), but with the added benefit of all the PrimeVue components at your disposal.

Do you need a separate Vue SPA front-end instead of using Inertia.js? Consider using the [Vue SPA w/ PrimeVue & Laravel Breeze API Starter Kit](https://github.com/connorabbas/primevue-spa-laravel-api) instead.

## Features
- Same auth structure and features as Laravel Breeze with User Profile page
- Need an admin panel? [There's a branch for that.](https://github.com/connorabbas/laravel-inertia-primevue/tree/feature/admin-panel)
- Need SSR support? [There's a branch for that.](https://github.com/connorabbas/laravel-inertia-primevue/tree/feature/ssr)
- Pre-configured [Auto Import](https://primevue.org/autoimport/) PrimeVue components
- Wrapper components for PrimeVue's `Menu`, `MenuBar`, & `PanelMenu` utilizing Inertia's `Link` component
- Light/Dark mode toggle with custom component & composable
- `useLazyDataTable()` composable for use with PrimeVue's `DataTable` component for easy filtering/sorting (example usage in `feature/admin-panel` branch)
- Easily customizable theming

- Same auth structure and features as Laravel Breeze with User Profile page
- Need an admin panel? [There's a branch for that.](https://github.com/connorabbas/laravel-inertia-primevue/tree/feature/admin-panel)
- Need SSR support? [There's a branch for that.](https://github.com/connorabbas/laravel-inertia-primevue/tree/feature/ssr)
- Pre-configured [Auto Import](https://primevue.org/autoimport/) PrimeVue components
- Wrapper components for PrimeVue's `Breadcrumb`, `Menu`, `MenuBar`, & `PanelMenu` utilizing Inertia's `Link` component
- Light/Dark mode toggle
- `usePaginatedData()` & `useLazyDataTable()` composables for use with PrimeVue's `Paginator` & `DataTable` components for easy pagination/filtering/sorting (example usage in `feature/admin-panel` branch)
- Easily customizable theming
- Configured to use TypeScript (not required)

## Theme

This starter kit provides a light/dark mode toggle by default, and custom theme functionality provided by the powerful **PrimeVue V4** theming system, using styled mode and custom design token values.

The starting point for customizing your theme will be the `resources/js/theme-preset.js` module file. To quickly change the look and feel of your site, swap the [primary](https://primevue.org/theming/styled/#primary) values with a different set of [colors](https://primevue.org/theming/styled/#colors), change the [surface](https://primevue.org/theming/styled/#surface) `colorScheme` values (slate, gray, neutral, etc.), or completely change the [preset theme](https://primevue.org/theming/styled/#presets) (Aura used by default).

Please reference the [PrimeVue Styled Mode Docs](https://primevue.org/theming/styled/) to fully understand how this system works, and how to further customize your theme to make it your own.

## PrimeVue v4 w/ Tailwind CSS

If you have used a previous version of this project using **PrimeVue V3**, you'll know that [PrimeFlex](https://primeflex.org/) was used instead of [Tailwind CSS](https://tailwindcss.com/) for utility class styling. With V4 however, the PrimeTek team has officially suggested [Moving from PrimeFlex to Tailwind CSS](https://primevue.org/guides/primeflex/).

For this reason PrimeFlex has been removed, and Tailwind has been added into the project, along with the [tailwindcss-primeui](https://primevue.org/tailwind/#plugin) plugin. CSS layers have also been implemented so the Tailwind utilities can [override](https://primevue.org/tailwind/#override) the PrimeVue component styling when needed.

---

## Usage with Docker

This starter kit is configured to use Docker Compose for local development with just a few extra steps, powered by images & configuration from [Laravel Sail](https://laravel.com/docs/master/sail). With this setup, you do not need PHP, Composer, PostgreSQL or Node.js installed on your machine to get up and running with this project.

### Setup

1. In a new directory (outside of your Laravel project) create a `docker-compose.yml` file to create a reverse proxy container using [Traefik](https://doc.traefik.io/traefik/getting-started/quick-start/). You can clone/reference this [example implementation](https://github.com/connorabbas/traefik-docker-compose/blob/master/docker-compose.yml).

2. Step into the directory containing the new compose file, and spin up the Traefik container:
```
docker compose up -d
```
3. Update Laravel app `.env`

```env
# Use any desired domain ending with .localhost
# Match with value used in docker-compose.local.yml
Expand All @@ -59,10 +68,12 @@ This starter kit is configured to use Docker Compose for local development with
VITE_PORT=5173
FORWARD_DB_PORT=5432
```
3. Build the Laravel app container using one of the following techniques:
- Build manually using docker compose CLI (like above)
- Use [Laravel Sail](https://laravel.com/docs/master/sail)
- Build as a [VS Code Dev Container](https://code.visualstudio.com/docs/devcontainers/tutorial) using the `Dev Containers: Reopen in Container` command

4. Build the Laravel app container using one of the following techniques:
- Build manually using docker compose CLI (like above)
- Use [Laravel Sail](https://laravel.com/docs/master/sail)
- Build as a [VS Code Dev Container](https://code.visualstudio.com/docs/devcontainers/tutorial) using the `Dev Containers: Reopen in Container` command

### Additional configuration
If you wish to add additional services, or swap out PostgreSQL with an alternative database, you can reference the [Laravel Sail stubs](https://github.com/laravel/sail/tree/1.x/stubs) and update the `docker-compose.local.yml` file as needed.

If you wish to add additional services, or swap out PostgreSQL with an alternative database, you can reference the [Laravel Sail stubs](https://github.com/laravel/sail/tree/1.x/stubs) and update the `docker-compose.local.yml` file as needed.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/NewPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function create(Request $request): Response
/**
* Handle an incoming new password request.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function store(Request $request): RedirectResponse
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/PasswordResetLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function create(): Response
/**
* Handle an incoming password reset link request.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function store(Request $request): RedirectResponse
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Requests/Auth/LoginRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function rules(): array
/**
* Attempt to authenticate the request's credentials.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function authenticate(): void
{
Expand All @@ -55,7 +55,7 @@ public function authenticate(): void
/**
* Ensure the login request is not rate limited.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function ensureIsNotRateLimited(): void
{
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [
\App\Http\Middleware\HandleInertiaRequests::class,
\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
App\Http\Middleware\HandleInertiaRequests::class,
Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
]);

//
Expand Down
72 changes: 72 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// https://eslint.org/docs/latest/use/configure/
// https://eslint.vuejs.org/user-guide/
// https://typescript-eslint.io/rules/?=recommended

import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginVue from 'eslint-plugin-vue';
import globals from 'globals';
import typescriptEslint from 'typescript-eslint';

export default typescriptEslint.config(
{
ignores: [
'*.d.ts',
'**/coverage',
'**/dist',
'vendor/**',
'public/build/**',
],
},
{
files: ['**/*.js'],
...eslint.configs.recommended,
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
process: 'readonly',
module: 'readonly',
require: 'readonly',
Ziggy: 'readonly',
window: 'readonly',
},
},
},
{
files: ['**/*.{ts,vue}'],
extends: [
eslint.configs.recommended,
...typescriptEslint.configs.recommended,
...eslintPluginVue.configs['flat/strongly-recommended'],
],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
Ziggy: 'readonly',
},
sourceType: 'module',
parserOptions: {
parser: typescriptEslint.parser,
},
},
rules: {
'vue/require-default-prop': 'off',
'vue/attribute-hyphenation': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/multi-word-component-names': 'off',
'vue/block-lang': 'off',
'vue/first-attribute-linebreak': [
'error',
{
singleline: 'ignore',
multiline: 'ignore',
},
],
'@typescript-eslint/no-explicit-any': 'off',
},
},
eslintConfigPrettier
);
Loading