Skip to content

Commit 58d6ad0

Browse files
committed
Adding feature parity match with the react starter kit
1 parent 511b380 commit 58d6ad0

32 files changed

+1077
-109
lines changed

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.2
25+
tools: composer:v2
26+
coverage: xdebug
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: '18'
32+
cache: 'npm'
33+
34+
- name: Install Node dependencies
35+
run: npm ci
36+
37+
- name: Build assets
38+
run: npm run build
39+
40+
- name: Create SQLite Database
41+
run: touch database/database.sqlite
42+
43+
- name: Install Dependencies
44+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
45+
46+
- name: Copy Environment File
47+
run: cp .env.example .env
48+
49+
- name: Generate Application Key
50+
run: php artisan key:generate
51+
52+
- name: Tests
53+
run: ./vendor/bin/pest --ci

app/Http/Controllers/Settings/DeleteController.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

app/Http/Controllers/Settings/ProfileController.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Contracts\Auth\MustVerifyEmail;
88
use Illuminate\Http\RedirectResponse;
99
use Illuminate\Http\Request;
10+
use Illuminate\Support\Facades\Auth;
1011
use Illuminate\Support\Facades\Redirect;
1112
use Inertia\Inertia;
1213
use Inertia\Response;
@@ -39,4 +40,25 @@ public function update(ProfileUpdateRequest $request): RedirectResponse
3940

4041
return Redirect::route('profile.edit');
4142
}
43+
44+
/**
45+
* Delete the user's profile.
46+
*/
47+
public function destroy(Request $request): RedirectResponse
48+
{
49+
$request->validate([
50+
'password' => ['required', 'current_password'],
51+
]);
52+
53+
$user = $request->user();
54+
55+
Auth::logout();
56+
57+
$user->delete();
58+
59+
$request->session()->invalidate();
60+
$request->session()->regenerateToken();
61+
62+
return Redirect::to('/');
63+
}
4264
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Http\Requests\Settings;
4+
5+
use App\Models\User;
6+
use Illuminate\Foundation\Http\FormRequest;
7+
use Illuminate\Validation\Rule;
8+
9+
class ProfileUpdateRequest extends FormRequest
10+
{
11+
/**
12+
* Get the validation rules that apply to the request.
13+
*
14+
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
15+
*/
16+
public function rules(): array
17+
{
18+
return [
19+
'name' => ['required', 'string', 'max:255'],
20+
'email' => [
21+
'required',
22+
'string',
23+
'lowercase',
24+
'email',
25+
'max:255',
26+
Rule::unique(User::class)->ignore($this->user()->id),
27+
],
28+
];
29+
}
30+
}

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dev": "vite"
77
},
88
"devDependencies": {
9+
"@headlessui/vue": "^1.7.23",
910
"@inertiajs/vue3": "^2.0.0-beta.3",
1011
"@tailwindcss/forms": "^0.5.3",
1112
"@types/node": "^22.10.2",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script setup lang="ts">
2+
import { Sun, Moon, Monitor } from 'lucide-vue-next'
3+
import { useAppearance } from '@/Composables/useAppearance'
4+
5+
interface Props {
6+
class?: string
7+
}
8+
9+
const props = withDefaults(defineProps<Props>(), {
10+
class: ''
11+
})
12+
13+
const { appearance, updateAppearance } = useAppearance()
14+
15+
const tabs = [
16+
{ value: 'light', icon: Sun, label: 'Light' },
17+
{ value: 'dark', icon: Moon, label: 'Dark' },
18+
{ value: 'system', icon: Monitor, label: 'System' }
19+
] as const
20+
</script>
21+
22+
<template>
23+
<div
24+
:class="[
25+
'inline-flex bg-neutral-100 dark:bg-neutral-800 p-1 gap-1 rounded-lg',
26+
props.class
27+
]"
28+
>
29+
<button
30+
v-for="{ value, icon: Icon, label } in tabs"
31+
:key="value"
32+
@click="updateAppearance(value)"
33+
:class="[
34+
'flex items-center px-3.5 py-1.5 rounded-md transition-colors',
35+
appearance === value
36+
? 'bg-white dark:bg-neutral-700 shadow-sm dark:text-neutral-100'
37+
: 'hover:bg-neutral-200/60 text-neutral-500 hover:text-black dark:hover:bg-neutral-700/60 dark:text-neutral-400'
38+
]"
39+
>
40+
<Icon class="h-4 w-4 -ml-1" />
41+
<span class="ml-1.5 text-sm">{{ label }}</span>
42+
</button>
43+
</div>
44+
</template>

resources/js/Components/ApplicationLogo.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1+
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
3+
4+
defineOptions({
5+
inheritAttrs: false,
6+
})
7+
8+
interface Props {
9+
className?: HTMLAttributes['class']
10+
}
11+
12+
defineProps<Props>()
13+
</script>
14+
115
<template>
2-
<svg viewBox="0 0 316 316" xmlns="http://www.w3.org/2000/svg">
16+
<svg
17+
viewBox="0 0 316 316"
18+
xmlns="http://www.w3.org/2000/svg"
19+
:class="className"
20+
v-bind="$attrs"
21+
>
322
<path
423
fill="currentColor"
524
d="M305.8 81.125C305.77 80.995 305.69 80.885 305.65 80.755C305.56 80.525 305.49 80.285 305.37 80.075C305.29 79.935 305.17 79.815 305.07 79.685C304.94 79.515 304.83 79.325 304.68 79.175C304.55 79.045 304.39 78.955 304.25 78.845C304.09 78.715 303.95 78.575 303.77 78.475L251.32 48.275C249.97 47.495 248.31 47.495 246.96 48.275L194.51 78.475C194.33 78.575 194.19 78.725 194.03 78.845C193.89 78.955 193.73 79.045 193.6 79.175C193.45 79.325 193.34 79.515 193.21 79.685C193.11 79.815 192.99 79.935 192.91 80.075C192.79 80.285 192.71 80.525 192.63 80.755C192.58 80.875 192.51 80.995 192.48 81.125C192.38 81.495 192.33 81.875 192.33 82.265V139.625L148.62 164.795V52.575C148.62 52.185 148.57 51.805 148.47 51.435C148.44 51.305 148.36 51.195 148.32 51.065C148.23 50.835 148.16 50.595 148.04 50.385C147.96 50.245 147.84 50.125 147.74 49.995C147.61 49.825 147.5 49.635 147.35 49.485C147.22 49.355 147.06 49.265 146.92 49.155C146.76 49.025 146.62 48.885 146.44 48.785L93.99 18.585C92.64 17.805 90.98 17.805 89.63 18.585L37.18 48.785C37 48.885 36.86 49.035 36.7 49.155C36.56 49.265 36.4 49.355 36.27 49.485C36.12 49.635 36.01 49.825 35.88 49.995C35.78 50.125 35.66 50.245 35.58 50.385C35.46 50.595 35.38 50.835 35.3 51.065C35.25 51.185 35.18 51.305 35.15 51.435C35.05 51.805 35 52.185 35 52.575V232.235C35 233.795 35.84 235.245 37.19 236.025L142.1 296.425C142.33 296.555 142.58 296.635 142.82 296.725C142.93 296.765 143.04 296.835 143.16 296.865C143.53 296.965 143.9 297.015 144.28 297.015C144.66 297.015 145.03 296.965 145.4 296.865C145.5 296.835 145.59 296.775 145.69 296.745C145.95 296.655 146.21 296.565 146.45 296.435L251.36 236.035C252.72 235.255 253.55 233.815 253.55 232.245V174.885L303.81 145.945C305.17 145.165 306 143.725 306 142.155V82.265C305.95 81.875 305.89 81.495 305.8 81.125ZM144.2 227.205L100.57 202.515L146.39 176.135L196.66 147.195L240.33 172.335L208.29 190.625L144.2 227.205ZM244.75 114.995V164.795L226.39 154.225L201.03 139.625V89.825L219.39 100.395L244.75 114.995ZM249.12 57.105L292.81 82.265L249.12 107.425L205.43 82.265L249.12 57.105ZM114.49 184.425L96.13 194.995V85.305L121.49 70.705L139.85 60.135V169.815L114.49 184.425ZM91.76 27.425L135.45 52.585L91.76 77.745L48.07 52.585L91.76 27.425ZM43.67 60.135L62.03 70.705L87.39 85.305V202.545V202.555V202.565C87.39 202.735 87.44 202.895 87.46 203.055C87.49 203.265 87.49 203.485 87.55 203.695V203.705C87.6 203.875 87.69 204.035 87.76 204.195C87.84 204.375 87.89 204.575 87.99 204.745C87.99 204.745 87.99 204.755 88 204.755C88.09 204.905 88.22 205.035 88.33 205.175C88.45 205.335 88.55 205.495 88.69 205.635L88.7 205.645C88.82 205.765 88.98 205.855 89.12 205.965C89.28 206.085 89.42 206.225 89.59 206.325C89.6 206.325 89.6 206.325 89.61 206.335C89.62 206.335 89.62 206.345 89.63 206.345L139.87 234.775V285.065L43.67 229.705V60.135ZM244.75 229.705L148.58 285.075V234.775L219.8 194.115L244.75 179.875V229.705ZM297.2 139.625L253.49 164.795V114.995L278.85 100.395L297.21 89.825V139.625H297.2Z"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup lang="ts">
2+
import { Separator } from '@/Components/ui/separator'
3+
4+
interface Props {
5+
title: string
6+
description?: string
7+
}
8+
9+
defineProps<Props>()
10+
</script>
11+
12+
<template>
13+
<div class="space-y-0.5">
14+
<h2 class="text-lg sm:text-xl md:text-2xl font-bold tracking-tight">{{ title }}</h2>
15+
<p v-if="description" class="text-sm md:text-base text-muted-foreground">
16+
{{ description }}
17+
</p>
18+
</div>
19+
<Separator class="my-6" />
20+
</template>

resources/js/Components/NavUser.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const user = page.props.auth.user as User;
4848
size="lg"
4949
class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
5050
>
51-
<Avatar class="h-8 w-8 rounded-md">
51+
<Avatar class="h-8 w-8 rounded-md bg-sidebar-primary text-sidebar-primary-foreground">
5252
<AvatarImage :src="user.avatar" :alt="user.name" />
5353
<AvatarFallback class="rounded-md">
5454
{{ getInitials(user.name) }}
@@ -69,7 +69,7 @@ const user = page.props.auth.user as User;
6969
>
7070
<DropdownMenuLabel class="p-0 font-normal">
7171
<div class="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
72-
<Avatar class="h-8 w-8 rounded-md">
72+
<Avatar class="h-8 w-8 rounded-md bg-sidebar-primary text-sidebar-primary-foreground">
7373
<AvatarImage :src="user.avatar" :alt="user.name" />
7474
<AvatarFallback class="rounded-md">{{ getInitials(user.name) }}</AvatarFallback>
7575
</Avatar>

0 commit comments

Comments
 (0)