Skip to content

Commit

Permalink
⚡ Re-scaffold Laravel app
Browse files Browse the repository at this point in the history
laravel new with Vue frontend (ran in WSL)
  • Loading branch information
iqfareez committed Mar 6, 2025
1 parent 550502c commit e846958
Show file tree
Hide file tree
Showing 227 changed files with 6,643 additions and 3,662 deletions.
19 changes: 0 additions & 19 deletions .eslintrc.cjs

This file was deleted.

3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore
README.md export-ignore
45 changes: 45 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: linter

on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main

permissions:
contents: write

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'

- name: Install Dependencies
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
npm install
- name: Run Pint
run: vendor/bin/pint

- name: Format Frontend
run: npm run format

- name: Lint Frontend
run: npm run lint

# - name: Commit Changes
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: fix code style
# commit_options: '--no-verify'
53 changes: 53 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: tests

on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: xdebug

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Install Node Dependencies
run: npm ci

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- name: Copy Environment File
run: cp .env.example .env

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

- name: Publish Ziggy Configuration
run: php artisan ziggy:generate

- name: Build Assets
run: npm run build

- name: Tests
run: ./vendor/bin/pest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.phpunit.cache
/bootstrap/ssr
/node_modules
/public/build
/public/hot
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources/js/components/ui/*
resources/js/ziggy.js
17 changes: 14 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"semi": true,
"singleQuote": true,
"plugins": [
"prettier-plugin-organize-imports",
"prettier-plugin-tailwindcss"
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"printWidth": 150,
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"],
"tailwindFunctions": ["clsx", "cn"],
"tabWidth": 4,
"overrides": [
{
"files": "**/*.yml",
"options": {
"tabWidth": 2
}
}
]
}
66 changes: 0 additions & 66 deletions README.md

This file was deleted.

9 changes: 4 additions & 5 deletions app/Http/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
class AuthenticatedSessionController extends Controller
{
/**
* Display the login view.
* Show the login page.
*/
public function create(): Response
public function create(Request $request): Response
{
return Inertia::render('Auth/Login', [
return Inertia::render('auth/Login', [
'canResetPassword' => Route::has('password.request'),
'status' => session('status'),
'status' => $request->session()->get('status'),
]);
}

Expand All @@ -44,7 +44,6 @@ public function destroy(Request $request): RedirectResponse
Auth::guard('web')->logout();

$request->session()->invalidate();

$request->session()->regenerateToken();

return redirect('/');
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/ConfirmablePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
class ConfirmablePasswordController extends Controller
{
/**
* Show the confirm password view.
* Show the confirm password page.
*/
public function show(): Response
{
return Inertia::render('Auth/ConfirmPassword');
return Inertia::render('auth/ConfirmPassword');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
class EmailVerificationPromptController extends Controller
{
/**
* Display the email verification prompt.
* Show the email verification prompt page.
*/
public function __invoke(Request $request): RedirectResponse|Response
{
return $request->user()->hasVerifiedEmail()
? redirect()->intended(route('dashboard', absolute: false))
: Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
: Inertia::render('auth/VerifyEmail', ['status' => $request->session()->get('status')]);
}
}
10 changes: 5 additions & 5 deletions app/Http/Controllers/Auth/NewPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
class NewPasswordController extends Controller
{
/**
* Display the password reset view.
* Show the password reset page.
*/
public function create(Request $request): Response
{
return Inertia::render('Auth/ResetPassword', [
return Inertia::render('auth/ResetPassword', [
'email' => $request->email,
'token' => $request->route('token'),
]);
Expand Down Expand Up @@ -58,12 +58,12 @@ function ($user) use ($request) {
// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
if ($status == Password::PASSWORD_RESET) {
return redirect()->route('login')->with('status', __($status));
if ($status == Password::PasswordReset) {
return to_route('login')->with('status', __($status));
}

throw ValidationException::withMessages([
'email' => [trans($status)],
'email' => [__($status)],
]);
}
}
22 changes: 6 additions & 16 deletions app/Http/Controllers/Auth/PasswordResetLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Inertia\Response;

class PasswordResetLinkController extends Controller
{
/**
* Display the password reset link request view.
* Show the password reset link request page.
*/
public function create(): Response
public function create(Request $request): Response
{
return Inertia::render('Auth/ForgotPassword', [
'status' => session('status'),
return Inertia::render('auth/ForgotPassword', [
'status' => $request->session()->get('status'),
]);
}

Expand All @@ -33,19 +32,10 @@ public function store(Request $request): RedirectResponse
'email' => 'required|email',
]);

// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$status = Password::sendResetLink(
Password::sendResetLink(
$request->only('email')
);

if ($status == Password::RESET_LINK_SENT) {
return back()->with('status', __($status));
}

throw ValidationException::withMessages([
'email' => [trans($status)],
]);
return back()->with('status', __('A reset link will be sent if the account exists.'));
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
class RegisteredUserController extends Controller
{
/**
* Display the registration view.
* Show the registration page.
*/
public function create(): Response
{
return Inertia::render('Auth/Register');
return Inertia::render('auth/Register');
}

/**
Expand All @@ -46,6 +46,6 @@ public function store(Request $request): RedirectResponse

Auth::login($user);

return redirect(route('dashboard', absolute: false));
return to_route('dashboard');
}
}
4 changes: 3 additions & 1 deletion app/Http/Controllers/Auth/VerifyEmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function __invoke(EmailVerificationRequest $request): RedirectResponse
}

if ($request->user()->markEmailAsVerified()) {
event(new Verified($request->user()));
/** @var \Illuminate\Contracts\Auth\MustVerifyEmail $user */
$user = $request->user();
event(new Verified($user));
}

return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
Expand Down
Loading

0 comments on commit e846958

Please sign in to comment.