Skip to content

Commit c081580

Browse files
authored
Merge pull request #105 from connorabbas/admin-develop
Pull master, improvements
2 parents 85ed4c8 + ecbc256 commit c081580

Some content is hidden

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

52 files changed

+2285
-476
lines changed

.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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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))
44

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)>)
56

67
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.
78

app/Http/Controllers/Admin/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/Admin/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/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/Middleware/Authenticate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Authenticate extends DefaultAuthenticate
1010
/**
1111
* Get the path the user should be redirected to when they are not authenticated.
1212
*
13-
* @param \Illuminate\Http\Request $request
13+
* @param Request $request
1414
* @return string|null
1515
*/
1616
protected function redirectTo(Request $request)

app/Http/Middleware/EnsureAdminEmailIsVerified.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class EnsureAdminEmailIsVerified
1313
/**
1414
* Handle an incoming request.
1515
*
16-
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
16+
* @param Closure(Request): (Response) $next
1717
*/
1818
public function handle(Request $request, Closure $next): Response
1919
{

app/Http/Requests/Admin/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
{

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
@@ -15,8 +15,8 @@
1515
)
1616
->withMiddleware(function (Middleware $middleware) {
1717
$middleware->web(append: [
18-
\App\Http\Middleware\HandleInertiaRequests::class,
19-
\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
18+
App\Http\Middleware\HandleInertiaRequests::class,
19+
Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
2020
]);
2121
$middleware->alias([
2222
'auth' => Authenticate::class, // override default, for admin redirect

eslint.config.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
{ ignores: ['*.d.ts', '**/coverage', '**/dist', 'vendor/**', 'public/build/**'] },
13+
{
14+
files: ['**/*.js'],
15+
...eslint.configs.recommended,
16+
languageOptions: {
17+
ecmaVersion: 'latest',
18+
sourceType: 'module',
19+
globals: {
20+
...globals.browser,
21+
process: 'readonly',
22+
module: 'readonly',
23+
require: 'readonly',
24+
Ziggy: 'readonly',
25+
window: 'readonly',
26+
},
27+
},
28+
},
29+
{
30+
files: ['**/*.{ts,vue}'],
31+
extends: [
32+
eslint.configs.recommended,
33+
...typescriptEslint.configs.recommended,
34+
...eslintPluginVue.configs['flat/recommended'],
35+
],
36+
languageOptions: {
37+
ecmaVersion: 'latest',
38+
globals: {
39+
...globals.browser,
40+
Ziggy: 'readonly',
41+
},
42+
sourceType: 'module',
43+
parserOptions: {
44+
parser: typescriptEslint.parser,
45+
},
46+
},
47+
rules: {
48+
'vue/require-default-prop': 'off',
49+
'vue/attribute-hyphenation': 'off',
50+
'vue/multi-word-component-names': 'off',
51+
'vue/block-lang': 'off',
52+
'@typescript-eslint/no-explicit-any': 'off',
53+
},
54+
},
55+
eslintConfigPrettier
56+
);

0 commit comments

Comments
 (0)