## Prod

- Clone or Pull the repo
- Build on server
- Local : vite.config.ts -> wayfinder : valet
- Staging / Prod : vite.config.ts -> wayfinder : herd

```
command: "herd php artisan wayfinder:generate", // Local dev: Use this for Herd
command: "valet php artisan wayfinder:generate", //Local dev: Use this for Valet
command: "php artisan wayfinder:generate", // Staging/Prod on-server build
```

# Init

## Vue

```shell
# clean install
rm -rf node_modules package-lock.json

# init
nvm use
npm install
npm run build

# start
npm run dev
```

## Laravel

- first install: migrate with seed

```shell
php artisan migrate --seed
```

- update database keeping data

```shell
php artisan migrate
```

- clear config cache

```shell
valet php artisan config:clear
```

- clear route cache

```shell
valet php artisan route:clear
```

- clear views cache

```shell
valet php artisan view:clear
```

### Valet

- https://coloid-auth.test

```shell
# run commands on valet

## clean install
rm -rf vendor composer.lock
valet composer install

valet php artisan migrate --seed
valet php artisan config:clear
valet php artisan wayfinder:generate
```

### Vite config

```javascript
import { wayfinder } from '@laravel/vite-plugin-wayfinder';
import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue';
import laravel from 'laravel-vite-plugin';
import { defineConfig } from 'vite';

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/js/app.ts'],
            ssr: 'resources/js/ssr.ts',
            refresh: true,
        }),
        tailwindcss(),
        wayfinder({
            // command: "herd php artisan wayfinder:generate", // Use this for Herd
            command: 'valet php artisan wayfinder:generate', // Use this for Valet
            routes: true,
            actions: true,
            formVariants: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
});
```

## Emails

- Mailpit: http://localhost:8025/

## Email Verification Commands

Generate a one-click verification link for a specific user:

```shell
valet php artisan user:verification-link user@example.com

# Custom expiry (default: 7 days)
valet php artisan user:verification-link user@example.com --expires=30

# No expiry
valet php artisan user:verification-link user@example.com --expires=0
```

Generate verification links for all unverified users (outputs a table):

```shell
valet php artisan user:verification-links

# Custom expiry (default: 7 days)
valet php artisan user:verification-links --expires=30
```

Send a reminder email with a verification link to a specific user:

```shell
valet php artisan user:send-verification-reminder user@example.com

# Custom expiry (default: 7 days)
valet php artisan user:send-verification-reminder user@example.com --expires=30

# No expiry
valet php artisan user:send-verification-reminder user@example.com --expires=0
```

Send a reminder email to all unverified users:

```shell
valet php artisan user:send-verification-reminders

# Custom expiry (default: 7 days)
valet php artisan user:send-verification-reminders --expires=30
```

The email template is at `resources/views/emails/verify-reminder.blade.php`.
