Skip to content

Commit c314b72

Browse files
authored
Merge pull request #144 from connorabbas/master
Catch up
2 parents 76ff1a3 + a552f81 commit c314b72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3323
-1859
lines changed

.devcontainer/devcontainer.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@
2222
"esbenp.prettier-vscode",
2323
"mikestead.dotenv",
2424
"streetsidesoftware.code-spell-checker",
25-
"shd101wyy.markdown-preview-enhanced"
25+
"shd101wyy.markdown-preview-enhanced",
26+
"formulahendry.auto-rename-tag",
27+
"pmneo.tsimporter"
2628
],
27-
"settings": {}
29+
"settings": {
30+
"html.format.wrapAttributes": "force-expand-multiline",
31+
"[vue]": {
32+
"editor.defaultFormatter": "Vue.volar",
33+
"editor.tabSize": 4
34+
}
35+
}
2836
}
2937
},
3038
"remoteUser": "sail",

.github/workflows/laravel.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Laravel CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
8+
jobs:
9+
eslint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '20'
18+
cache: 'npm'
19+
20+
- name: Install Dependencies
21+
run: npm ci
22+
23+
- name: Run ESLint
24+
run: npm run lint
25+
26+
laravel:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
33+
with:
34+
php-version: '8.3'
35+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, json, libxml, zip
36+
37+
- name: Copy .env
38+
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
39+
40+
- name: Install PHP Dependencies
41+
run: composer install --prefer-dist --no-progress --no-interaction
42+
43+
- name: Run Pint
44+
run: vendor/bin/pint --test
45+
46+
- name: Setup Node.js
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: '20'
50+
cache: 'npm'
51+
52+
- name: Install Node Dependencies
53+
run: npm ci
54+
55+
- name: Build Frontend Assets
56+
run: npm run build
57+
58+
- name: Set Environment Variables
59+
run: |
60+
echo "APP_ENV=testing" >> .env
61+
echo "DB_CONNECTION=sqlite" >> .env
62+
echo "DB_DATABASE=database/database.sqlite" >> .env
63+
64+
- name: Generate Application Key
65+
run: php artisan key:generate
66+
67+
- name: Prepare Database
68+
run: |
69+
mkdir -p database
70+
touch database/database.sqlite
71+
72+
- name: Migrate Database
73+
env:
74+
DB_CONNECTION: sqlite
75+
DB_DATABASE: database/database.sqlite
76+
run: php artisan migrate:fresh --force
77+
78+
- name: Run Tests
79+
env:
80+
APP_ENV: testing
81+
DB_CONNECTION: sqlite
82+
DB_DATABASE: database/database.sqlite
83+
run: php artisan test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Homestead.yaml
1616
auth.json
1717
npm-debug.log
1818
yarn-error.log
19+
components.d.ts
1920
/.fleet
2021
/.idea
2122
/.vscode

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,56 @@
11
# Laravel, Inertia.js, & PrimeVue Starter Kit
2+
23
## About
3-
![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))
4+
5+
![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)
46

57

6-
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.
8+
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.
79

810
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.
911

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

2024
## Theme
25+
2126
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.
2227

2328
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).
2429

2530
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.
2631

2732
## PrimeVue v4 w/ Tailwind CSS
33+
2834
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/).
2935

3036
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.
3137

3238
---
3339

3440
## Usage with Docker
41+
3542
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.
3643

3744
### Setup
45+
3846
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).
3947

4048
2. Step into the directory containing the new compose file, and spin up the Traefik container:
4149
```
4250
docker compose up -d
4351
```
4452
3. Update Laravel app `.env`
53+
4554
```env
4655
# Use any desired domain ending with .localhost
4756
# Match with value used in docker-compose.local.yml
@@ -59,10 +68,12 @@ This starter kit is configured to use Docker Compose for local development with
5968
VITE_PORT=5173
6069
FORWARD_DB_PORT=5432
6170
```
62-
3. Build the Laravel app container using one of the following techniques:
63-
- Build manually using docker compose CLI (like above)
64-
- Use [Laravel Sail](https://laravel.com/docs/master/sail)
65-
- Build as a [VS Code Dev Container](https://code.visualstudio.com/docs/devcontainers/tutorial) using the `Dev Containers: Reopen in Container` command
71+
72+
4. Build the Laravel app container using one of the following techniques:
73+
- Build manually using docker compose CLI (like above)
74+
- Use [Laravel Sail](https://laravel.com/docs/master/sail)
75+
- Build as a [VS Code Dev Container](https://code.visualstudio.com/docs/devcontainers/tutorial) using the `Dev Containers: Reopen in Container` command
6676
6777
### Additional configuration
68-
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.
78+
79+
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.

app/Http/Controllers/Auth/NewPasswordController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function create(Request $request): Response
3030
/**
3131
* Handle an incoming new password request.
3232
*
33-
* @throws \Illuminate\Validation\ValidationException
33+
* @throws ValidationException
3434
*/
3535
public function store(Request $request): RedirectResponse
3636
{

app/Http/Controllers/Auth/PasswordResetLinkController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function create(): Response
2525
/**
2626
* Handle an incoming password reset link request.
2727
*
28-
* @throws \Illuminate\Validation\ValidationException
28+
* @throws ValidationException
2929
*/
3030
public function store(Request $request): RedirectResponse
3131
{

app/Http/Requests/Auth/LoginRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function rules(): array
3535
/**
3636
* Attempt to authenticate the request's credentials.
3737
*
38-
* @throws \Illuminate\Validation\ValidationException
38+
* @throws ValidationException
3939
*/
4040
public function authenticate(): void
4141
{
@@ -55,7 +55,7 @@ public function authenticate(): void
5555
/**
5656
* Ensure the login request is not rate limited.
5757
*
58-
* @throws \Illuminate\Validation\ValidationException
58+
* @throws ValidationException
5959
*/
6060
public function ensureIsNotRateLimited(): void
6161
{

bootstrap/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
)
1313
->withMiddleware(function (Middleware $middleware) {
1414
$middleware->web(append: [
15-
\App\Http\Middleware\HandleInertiaRequests::class,
16-
\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
15+
App\Http\Middleware\HandleInertiaRequests::class,
16+
Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
1717
]);
1818

1919
//

eslint.config.js

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// https://eslint.org/docs/latest/use/configure/
2+
// https://eslint.vuejs.org/user-guide/
3+
// https://typescript-eslint.io/rules/?=recommended
4+
5+
import eslint from '@eslint/js';
6+
import eslintConfigPrettier from 'eslint-config-prettier';
7+
import eslintPluginVue from 'eslint-plugin-vue';
8+
import globals from 'globals';
9+
import typescriptEslint from 'typescript-eslint';
10+
11+
export default typescriptEslint.config(
12+
{
13+
ignores: [
14+
'*.d.ts',
15+
'**/coverage',
16+
'**/dist',
17+
'vendor/**',
18+
'public/build/**',
19+
],
20+
},
21+
{
22+
files: ['**/*.js'],
23+
...eslint.configs.recommended,
24+
languageOptions: {
25+
ecmaVersion: 'latest',
26+
sourceType: 'module',
27+
globals: {
28+
...globals.browser,
29+
process: 'readonly',
30+
module: 'readonly',
31+
require: 'readonly',
32+
Ziggy: 'readonly',
33+
window: 'readonly',
34+
},
35+
},
36+
},
37+
{
38+
files: ['**/*.{ts,vue}'],
39+
extends: [
40+
eslint.configs.recommended,
41+
...typescriptEslint.configs.recommended,
42+
...eslintPluginVue.configs['flat/strongly-recommended'],
43+
],
44+
languageOptions: {
45+
ecmaVersion: 'latest',
46+
globals: {
47+
...globals.browser,
48+
Ziggy: 'readonly',
49+
},
50+
sourceType: 'module',
51+
parserOptions: {
52+
parser: typescriptEslint.parser,
53+
},
54+
},
55+
rules: {
56+
'vue/require-default-prop': 'off',
57+
'vue/attribute-hyphenation': 'off',
58+
'vue/v-on-event-hyphenation': 'off',
59+
'vue/multi-word-component-names': 'off',
60+
'vue/block-lang': 'off',
61+
'vue/first-attribute-linebreak': [
62+
'error',
63+
{
64+
singleline: 'ignore',
65+
multiline: 'ignore',
66+
},
67+
],
68+
'@typescript-eslint/no-explicit-any': 'off',
69+
},
70+
},
71+
eslintConfigPrettier
72+
);

0 commit comments

Comments
 (0)