update
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- laravel-sample/app/Http/Controllers/Auth/AuthenticatedSessionController.php +52 -0
- laravel-sample/app/Http/Controllers/Auth/ConfirmablePasswordController.php +41 -0
- laravel-sample/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +24 -0
- laravel-sample/app/Http/Controllers/Auth/EmailVerificationPromptController.php +22 -0
- laravel-sample/app/Http/Controllers/Auth/NewPasswordController.php +69 -0
- laravel-sample/app/Http/Controllers/Auth/PasswordController.php +29 -0
- laravel-sample/app/Http/Controllers/Auth/PasswordResetLinkController.php +51 -0
- laravel-sample/app/Http/Controllers/Auth/RegisteredUserController.php +51 -0
- laravel-sample/app/Http/Controllers/Auth/VerifyEmailController.php +27 -0
- laravel-sample/app/Http/Controllers/ProfileController.php +63 -0
- laravel-sample/app/Http/Middleware/ForceHttps.php +18 -0
- laravel-sample/app/Http/Middleware/HandleInertiaRequests.php +39 -0
- laravel-sample/app/Http/Middleware/TrustProxies.php +24 -0
- laravel-sample/app/Http/Requests/Auth/LoginRequest.php +85 -0
- laravel-sample/app/Http/Requests/ProfileUpdateRequest.php +30 -0
- laravel-sample/app/Providers/AppServiceProvider.php +9 -1
- laravel-sample/bootstrap/app.php +5 -0
- laravel-sample/composer.json +5 -1
- laravel-sample/composer.lock +264 -1
- laravel-sample/jsconfig.json +10 -0
- laravel-sample/package-lock.json +0 -0
- laravel-sample/package.json +9 -1
- laravel-sample/postcss.config.js +6 -0
- laravel-sample/resources/css/app.css +3 -11
- laravel-sample/resources/js/Components/ApplicationLogo.jsx +11 -0
- laravel-sample/resources/js/Components/Checkbox.jsx +12 -0
- laravel-sample/resources/js/Components/DangerButton.jsx +20 -0
- laravel-sample/resources/js/Components/Dropdown.jsx +107 -0
- laravel-sample/resources/js/Components/InputError.jsx +10 -0
- laravel-sample/resources/js/Components/InputLabel.jsx +18 -0
- laravel-sample/resources/js/Components/Modal.jsx +65 -0
- laravel-sample/resources/js/Components/NavLink.jsx +23 -0
- laravel-sample/resources/js/Components/PrimaryButton.jsx +20 -0
- laravel-sample/resources/js/Components/ResponsiveNavLink.jsx +21 -0
- laravel-sample/resources/js/Components/SecondaryButton.jsx +22 -0
- laravel-sample/resources/js/Components/TextInput.jsx +30 -0
- laravel-sample/resources/js/Layouts/AuthenticatedLayout.jsx +176 -0
- laravel-sample/resources/js/Layouts/GuestLayout.jsx +18 -0
- laravel-sample/resources/js/Pages/Auth/ConfirmPassword.jsx +55 -0
- laravel-sample/resources/js/Pages/Auth/ForgotPassword.jsx +55 -0
- laravel-sample/resources/js/Pages/Auth/Login.jsx +100 -0
- laravel-sample/resources/js/Pages/Auth/Register.jsx +120 -0
- laravel-sample/resources/js/Pages/Auth/ResetPassword.jsx +94 -0
- laravel-sample/resources/js/Pages/Auth/VerifyEmail.jsx +50 -0
- laravel-sample/resources/js/Pages/Dashboard.jsx +26 -0
- laravel-sample/resources/js/Pages/Profile/Edit.jsx +39 -0
- laravel-sample/resources/js/Pages/Profile/Partials/DeleteUserForm.jsx +120 -0
- laravel-sample/resources/js/Pages/Profile/Partials/UpdatePasswordForm.jsx +142 -0
- laravel-sample/resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.jsx +113 -0
- laravel-sample/resources/js/Pages/Welcome.jsx +361 -0
laravel-sample/app/Http/Controllers/Auth/AuthenticatedSessionController.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use App\Http\Requests\Auth\LoginRequest;
|
7 |
+
use Illuminate\Http\RedirectResponse;
|
8 |
+
use Illuminate\Http\Request;
|
9 |
+
use Illuminate\Support\Facades\Auth;
|
10 |
+
use Illuminate\Support\Facades\Route;
|
11 |
+
use Inertia\Inertia;
|
12 |
+
use Inertia\Response;
|
13 |
+
|
14 |
+
class AuthenticatedSessionController extends Controller
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Display the login view.
|
18 |
+
*/
|
19 |
+
public function create(): Response
|
20 |
+
{
|
21 |
+
return Inertia::render('Auth/Login', [
|
22 |
+
'canResetPassword' => Route::has('password.request'),
|
23 |
+
'status' => session('status'),
|
24 |
+
]);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Handle an incoming authentication request.
|
29 |
+
*/
|
30 |
+
public function store(LoginRequest $request): RedirectResponse
|
31 |
+
{
|
32 |
+
$request->authenticate();
|
33 |
+
|
34 |
+
$request->session()->regenerate();
|
35 |
+
|
36 |
+
return redirect()->intended(route('dashboard', absolute: false));
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Destroy an authenticated session.
|
41 |
+
*/
|
42 |
+
public function destroy(Request $request): RedirectResponse
|
43 |
+
{
|
44 |
+
Auth::guard('web')->logout();
|
45 |
+
|
46 |
+
$request->session()->invalidate();
|
47 |
+
|
48 |
+
$request->session()->regenerateToken();
|
49 |
+
|
50 |
+
return redirect('/');
|
51 |
+
}
|
52 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/ConfirmablePasswordController.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Http\RedirectResponse;
|
7 |
+
use Illuminate\Http\Request;
|
8 |
+
use Illuminate\Support\Facades\Auth;
|
9 |
+
use Illuminate\Validation\ValidationException;
|
10 |
+
use Inertia\Inertia;
|
11 |
+
use Inertia\Response;
|
12 |
+
|
13 |
+
class ConfirmablePasswordController extends Controller
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Show the confirm password view.
|
17 |
+
*/
|
18 |
+
public function show(): Response
|
19 |
+
{
|
20 |
+
return Inertia::render('Auth/ConfirmPassword');
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Confirm the user's password.
|
25 |
+
*/
|
26 |
+
public function store(Request $request): RedirectResponse
|
27 |
+
{
|
28 |
+
if (! Auth::guard('web')->validate([
|
29 |
+
'email' => $request->user()->email,
|
30 |
+
'password' => $request->password,
|
31 |
+
])) {
|
32 |
+
throw ValidationException::withMessages([
|
33 |
+
'password' => __('auth.password'),
|
34 |
+
]);
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->session()->put('auth.password_confirmed_at', time());
|
38 |
+
|
39 |
+
return redirect()->intended(route('dashboard', absolute: false));
|
40 |
+
}
|
41 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/EmailVerificationNotificationController.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Http\RedirectResponse;
|
7 |
+
use Illuminate\Http\Request;
|
8 |
+
|
9 |
+
class EmailVerificationNotificationController extends Controller
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Send a new email verification notification.
|
13 |
+
*/
|
14 |
+
public function store(Request $request): RedirectResponse
|
15 |
+
{
|
16 |
+
if ($request->user()->hasVerifiedEmail()) {
|
17 |
+
return redirect()->intended(route('dashboard', absolute: false));
|
18 |
+
}
|
19 |
+
|
20 |
+
$request->user()->sendEmailVerificationNotification();
|
21 |
+
|
22 |
+
return back()->with('status', 'verification-link-sent');
|
23 |
+
}
|
24 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/EmailVerificationPromptController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Http\RedirectResponse;
|
7 |
+
use Illuminate\Http\Request;
|
8 |
+
use Inertia\Inertia;
|
9 |
+
use Inertia\Response;
|
10 |
+
|
11 |
+
class EmailVerificationPromptController extends Controller
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* Display the email verification prompt.
|
15 |
+
*/
|
16 |
+
public function __invoke(Request $request): RedirectResponse|Response
|
17 |
+
{
|
18 |
+
return $request->user()->hasVerifiedEmail()
|
19 |
+
? redirect()->intended(route('dashboard', absolute: false))
|
20 |
+
: Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
|
21 |
+
}
|
22 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/NewPasswordController.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Auth\Events\PasswordReset;
|
7 |
+
use Illuminate\Http\RedirectResponse;
|
8 |
+
use Illuminate\Http\Request;
|
9 |
+
use Illuminate\Support\Facades\Hash;
|
10 |
+
use Illuminate\Support\Facades\Password;
|
11 |
+
use Illuminate\Support\Str;
|
12 |
+
use Illuminate\Validation\Rules;
|
13 |
+
use Illuminate\Validation\ValidationException;
|
14 |
+
use Inertia\Inertia;
|
15 |
+
use Inertia\Response;
|
16 |
+
|
17 |
+
class NewPasswordController extends Controller
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Display the password reset view.
|
21 |
+
*/
|
22 |
+
public function create(Request $request): Response
|
23 |
+
{
|
24 |
+
return Inertia::render('Auth/ResetPassword', [
|
25 |
+
'email' => $request->email,
|
26 |
+
'token' => $request->route('token'),
|
27 |
+
]);
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Handle an incoming new password request.
|
32 |
+
*
|
33 |
+
* @throws \Illuminate\Validation\ValidationException
|
34 |
+
*/
|
35 |
+
public function store(Request $request): RedirectResponse
|
36 |
+
{
|
37 |
+
$request->validate([
|
38 |
+
'token' => 'required',
|
39 |
+
'email' => 'required|email',
|
40 |
+
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
41 |
+
]);
|
42 |
+
|
43 |
+
// Here we will attempt to reset the user's password. If it is successful we
|
44 |
+
// will update the password on an actual user model and persist it to the
|
45 |
+
// database. Otherwise we will parse the error and return the response.
|
46 |
+
$status = Password::reset(
|
47 |
+
$request->only('email', 'password', 'password_confirmation', 'token'),
|
48 |
+
function ($user) use ($request) {
|
49 |
+
$user->forceFill([
|
50 |
+
'password' => Hash::make($request->password),
|
51 |
+
'remember_token' => Str::random(60),
|
52 |
+
])->save();
|
53 |
+
|
54 |
+
event(new PasswordReset($user));
|
55 |
+
}
|
56 |
+
);
|
57 |
+
|
58 |
+
// If the password was successfully reset, we will redirect the user back to
|
59 |
+
// the application's home authenticated view. If there is an error we can
|
60 |
+
// redirect them back to where they came from with their error message.
|
61 |
+
if ($status == Password::PASSWORD_RESET) {
|
62 |
+
return redirect()->route('login')->with('status', __($status));
|
63 |
+
}
|
64 |
+
|
65 |
+
throw ValidationException::withMessages([
|
66 |
+
'email' => [trans($status)],
|
67 |
+
]);
|
68 |
+
}
|
69 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/PasswordController.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Http\RedirectResponse;
|
7 |
+
use Illuminate\Http\Request;
|
8 |
+
use Illuminate\Support\Facades\Hash;
|
9 |
+
use Illuminate\Validation\Rules\Password;
|
10 |
+
|
11 |
+
class PasswordController extends Controller
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* Update the user's password.
|
15 |
+
*/
|
16 |
+
public function update(Request $request): RedirectResponse
|
17 |
+
{
|
18 |
+
$validated = $request->validate([
|
19 |
+
'current_password' => ['required', 'current_password'],
|
20 |
+
'password' => ['required', Password::defaults(), 'confirmed'],
|
21 |
+
]);
|
22 |
+
|
23 |
+
$request->user()->update([
|
24 |
+
'password' => Hash::make($validated['password']),
|
25 |
+
]);
|
26 |
+
|
27 |
+
return back();
|
28 |
+
}
|
29 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/PasswordResetLinkController.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Http\RedirectResponse;
|
7 |
+
use Illuminate\Http\Request;
|
8 |
+
use Illuminate\Support\Facades\Password;
|
9 |
+
use Illuminate\Validation\ValidationException;
|
10 |
+
use Inertia\Inertia;
|
11 |
+
use Inertia\Response;
|
12 |
+
|
13 |
+
class PasswordResetLinkController extends Controller
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Display the password reset link request view.
|
17 |
+
*/
|
18 |
+
public function create(): Response
|
19 |
+
{
|
20 |
+
return Inertia::render('Auth/ForgotPassword', [
|
21 |
+
'status' => session('status'),
|
22 |
+
]);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Handle an incoming password reset link request.
|
27 |
+
*
|
28 |
+
* @throws \Illuminate\Validation\ValidationException
|
29 |
+
*/
|
30 |
+
public function store(Request $request): RedirectResponse
|
31 |
+
{
|
32 |
+
$request->validate([
|
33 |
+
'email' => 'required|email',
|
34 |
+
]);
|
35 |
+
|
36 |
+
// We will send the password reset link to this user. Once we have attempted
|
37 |
+
// to send the link, we will examine the response then see the message we
|
38 |
+
// need to show to the user. Finally, we'll send out a proper response.
|
39 |
+
$status = Password::sendResetLink(
|
40 |
+
$request->only('email')
|
41 |
+
);
|
42 |
+
|
43 |
+
if ($status == Password::RESET_LINK_SENT) {
|
44 |
+
return back()->with('status', __($status));
|
45 |
+
}
|
46 |
+
|
47 |
+
throw ValidationException::withMessages([
|
48 |
+
'email' => [trans($status)],
|
49 |
+
]);
|
50 |
+
}
|
51 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/RegisteredUserController.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use App\Models\User;
|
7 |
+
use Illuminate\Auth\Events\Registered;
|
8 |
+
use Illuminate\Http\RedirectResponse;
|
9 |
+
use Illuminate\Http\Request;
|
10 |
+
use Illuminate\Support\Facades\Auth;
|
11 |
+
use Illuminate\Support\Facades\Hash;
|
12 |
+
use Illuminate\Validation\Rules;
|
13 |
+
use Inertia\Inertia;
|
14 |
+
use Inertia\Response;
|
15 |
+
|
16 |
+
class RegisteredUserController extends Controller
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Display the registration view.
|
20 |
+
*/
|
21 |
+
public function create(): Response
|
22 |
+
{
|
23 |
+
return Inertia::render('Auth/Register');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Handle an incoming registration request.
|
28 |
+
*
|
29 |
+
* @throws \Illuminate\Validation\ValidationException
|
30 |
+
*/
|
31 |
+
public function store(Request $request): RedirectResponse
|
32 |
+
{
|
33 |
+
$request->validate([
|
34 |
+
'name' => 'required|string|max:255',
|
35 |
+
'email' => 'required|string|lowercase|email|max:255|unique:'.User::class,
|
36 |
+
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
37 |
+
]);
|
38 |
+
|
39 |
+
$user = User::create([
|
40 |
+
'name' => $request->name,
|
41 |
+
'email' => $request->email,
|
42 |
+
'password' => Hash::make($request->password),
|
43 |
+
]);
|
44 |
+
|
45 |
+
event(new Registered($user));
|
46 |
+
|
47 |
+
Auth::login($user);
|
48 |
+
|
49 |
+
return redirect(route('dashboard', absolute: false));
|
50 |
+
}
|
51 |
+
}
|
laravel-sample/app/Http/Controllers/Auth/VerifyEmailController.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers\Auth;
|
4 |
+
|
5 |
+
use App\Http\Controllers\Controller;
|
6 |
+
use Illuminate\Auth\Events\Verified;
|
7 |
+
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
8 |
+
use Illuminate\Http\RedirectResponse;
|
9 |
+
|
10 |
+
class VerifyEmailController extends Controller
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Mark the authenticated user's email address as verified.
|
14 |
+
*/
|
15 |
+
public function __invoke(EmailVerificationRequest $request): RedirectResponse
|
16 |
+
{
|
17 |
+
if ($request->user()->hasVerifiedEmail()) {
|
18 |
+
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
|
19 |
+
}
|
20 |
+
|
21 |
+
if ($request->user()->markEmailAsVerified()) {
|
22 |
+
event(new Verified($request->user()));
|
23 |
+
}
|
24 |
+
|
25 |
+
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
|
26 |
+
}
|
27 |
+
}
|
laravel-sample/app/Http/Controllers/ProfileController.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Controllers;
|
4 |
+
|
5 |
+
use App\Http\Requests\ProfileUpdateRequest;
|
6 |
+
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
7 |
+
use Illuminate\Http\RedirectResponse;
|
8 |
+
use Illuminate\Http\Request;
|
9 |
+
use Illuminate\Support\Facades\Auth;
|
10 |
+
use Illuminate\Support\Facades\Redirect;
|
11 |
+
use Inertia\Inertia;
|
12 |
+
use Inertia\Response;
|
13 |
+
|
14 |
+
class ProfileController extends Controller
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Display the user's profile form.
|
18 |
+
*/
|
19 |
+
public function edit(Request $request): Response
|
20 |
+
{
|
21 |
+
return Inertia::render('Profile/Edit', [
|
22 |
+
'mustVerifyEmail' => $request->user() instanceof MustVerifyEmail,
|
23 |
+
'status' => session('status'),
|
24 |
+
]);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Update the user's profile information.
|
29 |
+
*/
|
30 |
+
public function update(ProfileUpdateRequest $request): RedirectResponse
|
31 |
+
{
|
32 |
+
$request->user()->fill($request->validated());
|
33 |
+
|
34 |
+
if ($request->user()->isDirty('email')) {
|
35 |
+
$request->user()->email_verified_at = null;
|
36 |
+
}
|
37 |
+
|
38 |
+
$request->user()->save();
|
39 |
+
|
40 |
+
return Redirect::route('profile.edit');
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Delete the user's account.
|
45 |
+
*/
|
46 |
+
public function destroy(Request $request): RedirectResponse
|
47 |
+
{
|
48 |
+
$request->validate([
|
49 |
+
'password' => ['required', 'current_password'],
|
50 |
+
]);
|
51 |
+
|
52 |
+
$user = $request->user();
|
53 |
+
|
54 |
+
Auth::logout();
|
55 |
+
|
56 |
+
$user->delete();
|
57 |
+
|
58 |
+
$request->session()->invalidate();
|
59 |
+
$request->session()->regenerateToken();
|
60 |
+
|
61 |
+
return Redirect::to('/');
|
62 |
+
}
|
63 |
+
}
|
laravel-sample/app/Http/Middleware/ForceHttps.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// app/Http/Middleware/ForceHttps.php
|
3 |
+
namespace App\Http\Middleware;
|
4 |
+
|
5 |
+
use Closure;
|
6 |
+
use Illuminate\Http\Request;
|
7 |
+
|
8 |
+
class ForceHttps
|
9 |
+
{
|
10 |
+
public function handle(Request $request, Closure $next)
|
11 |
+
{
|
12 |
+
if (!$request->secure()) {
|
13 |
+
return redirect()->secure($request->getRequestUri());
|
14 |
+
}
|
15 |
+
|
16 |
+
return $next($request);
|
17 |
+
}
|
18 |
+
}
|
laravel-sample/app/Http/Middleware/HandleInertiaRequests.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Middleware;
|
4 |
+
|
5 |
+
use Illuminate\Http\Request;
|
6 |
+
use Inertia\Middleware;
|
7 |
+
|
8 |
+
class HandleInertiaRequests extends Middleware
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* The root template that is loaded on the first page visit.
|
12 |
+
*
|
13 |
+
* @var string
|
14 |
+
*/
|
15 |
+
protected $rootView = 'app';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Determine the current asset version.
|
19 |
+
*/
|
20 |
+
public function version(Request $request): ?string
|
21 |
+
{
|
22 |
+
return parent::version($request);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Define the props that are shared by default.
|
27 |
+
*
|
28 |
+
* @return array<string, mixed>
|
29 |
+
*/
|
30 |
+
public function share(Request $request): array
|
31 |
+
{
|
32 |
+
return [
|
33 |
+
...parent::share($request),
|
34 |
+
'auth' => [
|
35 |
+
'user' => $request->user(),
|
36 |
+
],
|
37 |
+
];
|
38 |
+
}
|
39 |
+
}
|
laravel-sample/app/Http/Middleware/TrustProxies.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Middleware;
|
4 |
+
|
5 |
+
use Fideloper\Proxy\TrustProxies as Middleware;
|
6 |
+
use Illuminate\Http\Request;
|
7 |
+
|
8 |
+
class TrustProxies extends Middleware
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* ここで信頼するプロキシを指定
|
12 |
+
* * で全てのプロキシを信頼(環境に応じてIPを指定してもOK)
|
13 |
+
*
|
14 |
+
* @var array|string|null
|
15 |
+
*/
|
16 |
+
protected $proxies = '*';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* ヘッダー設定(X-Forwarded-* ヘッダーを信頼)
|
20 |
+
*
|
21 |
+
* @var int
|
22 |
+
*/
|
23 |
+
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
24 |
+
}
|
laravel-sample/app/Http/Requests/Auth/LoginRequest.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Requests\Auth;
|
4 |
+
|
5 |
+
use Illuminate\Auth\Events\Lockout;
|
6 |
+
use Illuminate\Foundation\Http\FormRequest;
|
7 |
+
use Illuminate\Support\Facades\Auth;
|
8 |
+
use Illuminate\Support\Facades\RateLimiter;
|
9 |
+
use Illuminate\Support\Str;
|
10 |
+
use Illuminate\Validation\ValidationException;
|
11 |
+
|
12 |
+
class LoginRequest extends FormRequest
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Determine if the user is authorized to make this request.
|
16 |
+
*/
|
17 |
+
public function authorize(): bool
|
18 |
+
{
|
19 |
+
return true;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get the validation rules that apply to the request.
|
24 |
+
*
|
25 |
+
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
26 |
+
*/
|
27 |
+
public function rules(): array
|
28 |
+
{
|
29 |
+
return [
|
30 |
+
'email' => ['required', 'string', 'email'],
|
31 |
+
'password' => ['required', 'string'],
|
32 |
+
];
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Attempt to authenticate the request's credentials.
|
37 |
+
*
|
38 |
+
* @throws \Illuminate\Validation\ValidationException
|
39 |
+
*/
|
40 |
+
public function authenticate(): void
|
41 |
+
{
|
42 |
+
$this->ensureIsNotRateLimited();
|
43 |
+
|
44 |
+
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
|
45 |
+
RateLimiter::hit($this->throttleKey());
|
46 |
+
|
47 |
+
throw ValidationException::withMessages([
|
48 |
+
'email' => trans('auth.failed'),
|
49 |
+
]);
|
50 |
+
}
|
51 |
+
|
52 |
+
RateLimiter::clear($this->throttleKey());
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Ensure the login request is not rate limited.
|
57 |
+
*
|
58 |
+
* @throws \Illuminate\Validation\ValidationException
|
59 |
+
*/
|
60 |
+
public function ensureIsNotRateLimited(): void
|
61 |
+
{
|
62 |
+
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
event(new Lockout($this));
|
67 |
+
|
68 |
+
$seconds = RateLimiter::availableIn($this->throttleKey());
|
69 |
+
|
70 |
+
throw ValidationException::withMessages([
|
71 |
+
'email' => trans('auth.throttle', [
|
72 |
+
'seconds' => $seconds,
|
73 |
+
'minutes' => ceil($seconds / 60),
|
74 |
+
]),
|
75 |
+
]);
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get the rate limiting throttle key for the request.
|
80 |
+
*/
|
81 |
+
public function throttleKey(): string
|
82 |
+
{
|
83 |
+
return Str::transliterate(Str::lower($this->string('email')).'|'.$this->ip());
|
84 |
+
}
|
85 |
+
}
|
laravel-sample/app/Http/Requests/ProfileUpdateRequest.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace App\Http\Requests;
|
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 |
+
}
|
laravel-sample/app/Providers/AppServiceProvider.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace App\Providers;
|
4 |
|
|
|
|
|
5 |
use Illuminate\Support\ServiceProvider;
|
6 |
|
7 |
class AppServiceProvider extends ServiceProvider
|
@@ -19,6 +21,12 @@ public function register(): void
|
|
19 |
*/
|
20 |
public function boot(): void
|
21 |
{
|
22 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
}
|
|
|
2 |
|
3 |
namespace App\Providers;
|
4 |
|
5 |
+
use Illuminate\Support\Facades\URL;
|
6 |
+
use Illuminate\Support\Facades\Vite;
|
7 |
use Illuminate\Support\ServiceProvider;
|
8 |
|
9 |
class AppServiceProvider extends ServiceProvider
|
|
|
21 |
*/
|
22 |
public function boot(): void
|
23 |
{
|
24 |
+
// Viteのプリフェッチ設定
|
25 |
+
Vite::prefetch(concurrency: 3);
|
26 |
+
|
27 |
+
// 環境がlocal以外なら強制的にHTTPSを使うURLを生成する
|
28 |
+
if (config('app.env') !== 'local') {
|
29 |
+
URL::forceScheme('https');
|
30 |
+
}
|
31 |
}
|
32 |
}
|
laravel-sample/bootstrap/app.php
CHANGED
@@ -11,6 +11,11 @@
|
|
11 |
health: '/up',
|
12 |
)
|
13 |
->withMiddleware(function (Middleware $middleware) {
|
|
|
|
|
|
|
|
|
|
|
14 |
//
|
15 |
})
|
16 |
->withExceptions(function (Exceptions $exceptions) {
|
|
|
11 |
health: '/up',
|
12 |
)
|
13 |
->withMiddleware(function (Middleware $middleware) {
|
14 |
+
$middleware->web(append: [
|
15 |
+
\App\Http\Middleware\HandleInertiaRequests::class,
|
16 |
+
\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
|
17 |
+
]);
|
18 |
+
|
19 |
//
|
20 |
})
|
21 |
->withExceptions(function (Exceptions $exceptions) {
|
laravel-sample/composer.json
CHANGED
@@ -7,11 +7,15 @@
|
|
7 |
"license": "MIT",
|
8 |
"require": {
|
9 |
"php": "^8.2",
|
|
|
10 |
"laravel/framework": "^12.0",
|
11 |
-
"laravel/
|
|
|
|
|
12 |
},
|
13 |
"require-dev": {
|
14 |
"fakerphp/faker": "^1.23",
|
|
|
15 |
"laravel/pail": "^1.2.2",
|
16 |
"laravel/pint": "^1.13",
|
17 |
"laravel/sail": "^1.41",
|
|
|
7 |
"license": "MIT",
|
8 |
"require": {
|
9 |
"php": "^8.2",
|
10 |
+
"inertiajs/inertia-laravel": "^2.0",
|
11 |
"laravel/framework": "^12.0",
|
12 |
+
"laravel/sanctum": "^4.0",
|
13 |
+
"laravel/tinker": "^2.10.1",
|
14 |
+
"tightenco/ziggy": "^2.0"
|
15 |
},
|
16 |
"require-dev": {
|
17 |
"fakerphp/faker": "^1.23",
|
18 |
+
"laravel/breeze": "^2.3",
|
19 |
"laravel/pail": "^1.2.2",
|
20 |
"laravel/pint": "^1.13",
|
21 |
"laravel/sail": "^1.41",
|
laravel-sample/composer.lock
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"content-hash": "
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "brick/math",
|
@@ -1054,6 +1054,74 @@
|
|
1054 |
],
|
1055 |
"time": "2025-02-03T10:55:03+00:00"
|
1056 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1057 |
{
|
1058 |
"name": "laravel/framework",
|
1059 |
"version": "v12.17.0",
|
@@ -1328,6 +1396,70 @@
|
|
1328 |
},
|
1329 |
"time": "2025-02-11T13:34:40+00:00"
|
1330 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1331 |
{
|
1332 |
"name": "laravel/serializable-closure",
|
1333 |
"version": "v2.0.4",
|
@@ -5508,6 +5640,76 @@
|
|
5508 |
],
|
5509 |
"time": "2025-04-27T18:39:23+00:00"
|
5510 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5511 |
{
|
5512 |
"name": "tijsverkoyen/css-to-inline-styles",
|
5513 |
"version": "v2.3.0",
|
@@ -5966,6 +6168,67 @@
|
|
5966 |
},
|
5967 |
"time": "2025-04-30T06:54:44+00:00"
|
5968 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5969 |
{
|
5970 |
"name": "laravel/pail",
|
5971 |
"version": "v1.2.3",
|
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "80efe4b3b82c9c7acdd39b013483f9ae",
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "brick/math",
|
|
|
1054 |
],
|
1055 |
"time": "2025-02-03T10:55:03+00:00"
|
1056 |
},
|
1057 |
+
{
|
1058 |
+
"name": "inertiajs/inertia-laravel",
|
1059 |
+
"version": "v2.0.2",
|
1060 |
+
"source": {
|
1061 |
+
"type": "git",
|
1062 |
+
"url": "https://github.com/inertiajs/inertia-laravel.git",
|
1063 |
+
"reference": "248e815cf8d41307cbfb735efaa514c118e2f3b4"
|
1064 |
+
},
|
1065 |
+
"dist": {
|
1066 |
+
"type": "zip",
|
1067 |
+
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/248e815cf8d41307cbfb735efaa514c118e2f3b4",
|
1068 |
+
"reference": "248e815cf8d41307cbfb735efaa514c118e2f3b4",
|
1069 |
+
"shasum": ""
|
1070 |
+
},
|
1071 |
+
"require": {
|
1072 |
+
"ext-json": "*",
|
1073 |
+
"laravel/framework": "^10.0|^11.0|^12.0",
|
1074 |
+
"php": "^8.1.0",
|
1075 |
+
"symfony/console": "^6.2|^7.0"
|
1076 |
+
},
|
1077 |
+
"require-dev": {
|
1078 |
+
"laravel/pint": "^1.16",
|
1079 |
+
"mockery/mockery": "^1.3.3",
|
1080 |
+
"orchestra/testbench": "^8.0|^9.2|^10.0",
|
1081 |
+
"phpunit/phpunit": "^10.4|^11.5",
|
1082 |
+
"roave/security-advisories": "dev-master"
|
1083 |
+
},
|
1084 |
+
"suggest": {
|
1085 |
+
"ext-pcntl": "Recommended when running the Inertia SSR server via the `inertia:start-ssr` artisan command."
|
1086 |
+
},
|
1087 |
+
"type": "library",
|
1088 |
+
"extra": {
|
1089 |
+
"laravel": {
|
1090 |
+
"providers": [
|
1091 |
+
"Inertia\\ServiceProvider"
|
1092 |
+
]
|
1093 |
+
}
|
1094 |
+
},
|
1095 |
+
"autoload": {
|
1096 |
+
"files": [
|
1097 |
+
"./helpers.php"
|
1098 |
+
],
|
1099 |
+
"psr-4": {
|
1100 |
+
"Inertia\\": "src"
|
1101 |
+
}
|
1102 |
+
},
|
1103 |
+
"notification-url": "https://packagist.org/downloads/",
|
1104 |
+
"license": [
|
1105 |
+
"MIT"
|
1106 |
+
],
|
1107 |
+
"authors": [
|
1108 |
+
{
|
1109 |
+
"name": "Jonathan Reinink",
|
1110 |
+
"email": "jonathan@reinink.ca",
|
1111 |
+
"homepage": "https://reinink.ca"
|
1112 |
+
}
|
1113 |
+
],
|
1114 |
+
"description": "The Laravel adapter for Inertia.js.",
|
1115 |
+
"keywords": [
|
1116 |
+
"inertia",
|
1117 |
+
"laravel"
|
1118 |
+
],
|
1119 |
+
"support": {
|
1120 |
+
"issues": "https://github.com/inertiajs/inertia-laravel/issues",
|
1121 |
+
"source": "https://github.com/inertiajs/inertia-laravel/tree/v2.0.2"
|
1122 |
+
},
|
1123 |
+
"time": "2025-04-10T15:08:36+00:00"
|
1124 |
+
},
|
1125 |
{
|
1126 |
"name": "laravel/framework",
|
1127 |
"version": "v12.17.0",
|
|
|
1396 |
},
|
1397 |
"time": "2025-02-11T13:34:40+00:00"
|
1398 |
},
|
1399 |
+
{
|
1400 |
+
"name": "laravel/sanctum",
|
1401 |
+
"version": "v4.1.1",
|
1402 |
+
"source": {
|
1403 |
+
"type": "git",
|
1404 |
+
"url": "https://github.com/laravel/sanctum.git",
|
1405 |
+
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5"
|
1406 |
+
},
|
1407 |
+
"dist": {
|
1408 |
+
"type": "zip",
|
1409 |
+
"url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
|
1410 |
+
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
|
1411 |
+
"shasum": ""
|
1412 |
+
},
|
1413 |
+
"require": {
|
1414 |
+
"ext-json": "*",
|
1415 |
+
"illuminate/console": "^11.0|^12.0",
|
1416 |
+
"illuminate/contracts": "^11.0|^12.0",
|
1417 |
+
"illuminate/database": "^11.0|^12.0",
|
1418 |
+
"illuminate/support": "^11.0|^12.0",
|
1419 |
+
"php": "^8.2",
|
1420 |
+
"symfony/console": "^7.0"
|
1421 |
+
},
|
1422 |
+
"require-dev": {
|
1423 |
+
"mockery/mockery": "^1.6",
|
1424 |
+
"orchestra/testbench": "^9.0|^10.0",
|
1425 |
+
"phpstan/phpstan": "^1.10",
|
1426 |
+
"phpunit/phpunit": "^11.3"
|
1427 |
+
},
|
1428 |
+
"type": "library",
|
1429 |
+
"extra": {
|
1430 |
+
"laravel": {
|
1431 |
+
"providers": [
|
1432 |
+
"Laravel\\Sanctum\\SanctumServiceProvider"
|
1433 |
+
]
|
1434 |
+
}
|
1435 |
+
},
|
1436 |
+
"autoload": {
|
1437 |
+
"psr-4": {
|
1438 |
+
"Laravel\\Sanctum\\": "src/"
|
1439 |
+
}
|
1440 |
+
},
|
1441 |
+
"notification-url": "https://packagist.org/downloads/",
|
1442 |
+
"license": [
|
1443 |
+
"MIT"
|
1444 |
+
],
|
1445 |
+
"authors": [
|
1446 |
+
{
|
1447 |
+
"name": "Taylor Otwell",
|
1448 |
+
"email": "taylor@laravel.com"
|
1449 |
+
}
|
1450 |
+
],
|
1451 |
+
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
|
1452 |
+
"keywords": [
|
1453 |
+
"auth",
|
1454 |
+
"laravel",
|
1455 |
+
"sanctum"
|
1456 |
+
],
|
1457 |
+
"support": {
|
1458 |
+
"issues": "https://github.com/laravel/sanctum/issues",
|
1459 |
+
"source": "https://github.com/laravel/sanctum"
|
1460 |
+
},
|
1461 |
+
"time": "2025-04-23T13:03:38+00:00"
|
1462 |
+
},
|
1463 |
{
|
1464 |
"name": "laravel/serializable-closure",
|
1465 |
"version": "v2.0.4",
|
|
|
5640 |
],
|
5641 |
"time": "2025-04-27T18:39:23+00:00"
|
5642 |
},
|
5643 |
+
{
|
5644 |
+
"name": "tightenco/ziggy",
|
5645 |
+
"version": "v2.5.3",
|
5646 |
+
"source": {
|
5647 |
+
"type": "git",
|
5648 |
+
"url": "https://github.com/tighten/ziggy.git",
|
5649 |
+
"reference": "0b3b521d2c55fbdb04b6721532f7f5f49d32f52b"
|
5650 |
+
},
|
5651 |
+
"dist": {
|
5652 |
+
"type": "zip",
|
5653 |
+
"url": "https://api.github.com/repos/tighten/ziggy/zipball/0b3b521d2c55fbdb04b6721532f7f5f49d32f52b",
|
5654 |
+
"reference": "0b3b521d2c55fbdb04b6721532f7f5f49d32f52b",
|
5655 |
+
"shasum": ""
|
5656 |
+
},
|
5657 |
+
"require": {
|
5658 |
+
"ext-json": "*",
|
5659 |
+
"laravel/framework": ">=9.0",
|
5660 |
+
"php": ">=8.1"
|
5661 |
+
},
|
5662 |
+
"require-dev": {
|
5663 |
+
"laravel/folio": "^1.1",
|
5664 |
+
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0 || ^10.0",
|
5665 |
+
"pestphp/pest": "^2.26|^3.0",
|
5666 |
+
"pestphp/pest-plugin-laravel": "^2.4|^3.0"
|
5667 |
+
},
|
5668 |
+
"type": "library",
|
5669 |
+
"extra": {
|
5670 |
+
"laravel": {
|
5671 |
+
"providers": [
|
5672 |
+
"Tighten\\Ziggy\\ZiggyServiceProvider"
|
5673 |
+
]
|
5674 |
+
}
|
5675 |
+
},
|
5676 |
+
"autoload": {
|
5677 |
+
"psr-4": {
|
5678 |
+
"Tighten\\Ziggy\\": "src/"
|
5679 |
+
}
|
5680 |
+
},
|
5681 |
+
"notification-url": "https://packagist.org/downloads/",
|
5682 |
+
"license": [
|
5683 |
+
"MIT"
|
5684 |
+
],
|
5685 |
+
"authors": [
|
5686 |
+
{
|
5687 |
+
"name": "Daniel Coulbourne",
|
5688 |
+
"email": "daniel@tighten.co"
|
5689 |
+
},
|
5690 |
+
{
|
5691 |
+
"name": "Jake Bathman",
|
5692 |
+
"email": "jake@tighten.co"
|
5693 |
+
},
|
5694 |
+
{
|
5695 |
+
"name": "Jacob Baker-Kretzmar",
|
5696 |
+
"email": "jacob@tighten.co"
|
5697 |
+
}
|
5698 |
+
],
|
5699 |
+
"description": "Use your Laravel named routes in JavaScript.",
|
5700 |
+
"homepage": "https://github.com/tighten/ziggy",
|
5701 |
+
"keywords": [
|
5702 |
+
"Ziggy",
|
5703 |
+
"javascript",
|
5704 |
+
"laravel",
|
5705 |
+
"routes"
|
5706 |
+
],
|
5707 |
+
"support": {
|
5708 |
+
"issues": "https://github.com/tighten/ziggy/issues",
|
5709 |
+
"source": "https://github.com/tighten/ziggy/tree/v2.5.3"
|
5710 |
+
},
|
5711 |
+
"time": "2025-05-17T18:15:19+00:00"
|
5712 |
+
},
|
5713 |
{
|
5714 |
"name": "tijsverkoyen/css-to-inline-styles",
|
5715 |
"version": "v2.3.0",
|
|
|
6168 |
},
|
6169 |
"time": "2025-04-30T06:54:44+00:00"
|
6170 |
},
|
6171 |
+
{
|
6172 |
+
"name": "laravel/breeze",
|
6173 |
+
"version": "v2.3.6",
|
6174 |
+
"source": {
|
6175 |
+
"type": "git",
|
6176 |
+
"url": "https://github.com/laravel/breeze.git",
|
6177 |
+
"reference": "390cbc433cb72fa6050965000b2d56c9ba6fd713"
|
6178 |
+
},
|
6179 |
+
"dist": {
|
6180 |
+
"type": "zip",
|
6181 |
+
"url": "https://api.github.com/repos/laravel/breeze/zipball/390cbc433cb72fa6050965000b2d56c9ba6fd713",
|
6182 |
+
"reference": "390cbc433cb72fa6050965000b2d56c9ba6fd713",
|
6183 |
+
"shasum": ""
|
6184 |
+
},
|
6185 |
+
"require": {
|
6186 |
+
"illuminate/console": "^11.0|^12.0",
|
6187 |
+
"illuminate/filesystem": "^11.0|^12.0",
|
6188 |
+
"illuminate/support": "^11.0|^12.0",
|
6189 |
+
"illuminate/validation": "^11.0|^12.0",
|
6190 |
+
"php": "^8.2.0",
|
6191 |
+
"symfony/console": "^7.0"
|
6192 |
+
},
|
6193 |
+
"require-dev": {
|
6194 |
+
"laravel/framework": "^11.0|^12.0",
|
6195 |
+
"orchestra/testbench-core": "^9.0|^10.0",
|
6196 |
+
"phpstan/phpstan": "^2.0"
|
6197 |
+
},
|
6198 |
+
"type": "library",
|
6199 |
+
"extra": {
|
6200 |
+
"laravel": {
|
6201 |
+
"providers": [
|
6202 |
+
"Laravel\\Breeze\\BreezeServiceProvider"
|
6203 |
+
]
|
6204 |
+
}
|
6205 |
+
},
|
6206 |
+
"autoload": {
|
6207 |
+
"psr-4": {
|
6208 |
+
"Laravel\\Breeze\\": "src/"
|
6209 |
+
}
|
6210 |
+
},
|
6211 |
+
"notification-url": "https://packagist.org/downloads/",
|
6212 |
+
"license": [
|
6213 |
+
"MIT"
|
6214 |
+
],
|
6215 |
+
"authors": [
|
6216 |
+
{
|
6217 |
+
"name": "Taylor Otwell",
|
6218 |
+
"email": "taylor@laravel.com"
|
6219 |
+
}
|
6220 |
+
],
|
6221 |
+
"description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
|
6222 |
+
"keywords": [
|
6223 |
+
"auth",
|
6224 |
+
"laravel"
|
6225 |
+
],
|
6226 |
+
"support": {
|
6227 |
+
"issues": "https://github.com/laravel/breeze/issues",
|
6228 |
+
"source": "https://github.com/laravel/breeze"
|
6229 |
+
},
|
6230 |
+
"time": "2025-03-06T14:02:32+00:00"
|
6231 |
+
},
|
6232 |
{
|
6233 |
"name": "laravel/pail",
|
6234 |
"version": "v1.2.3",
|
laravel-sample/jsconfig.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compilerOptions": {
|
3 |
+
"baseUrl": ".",
|
4 |
+
"paths": {
|
5 |
+
"@/*": ["resources/js/*"],
|
6 |
+
"ziggy-js": ["./vendor/tightenco/ziggy"]
|
7 |
+
}
|
8 |
+
},
|
9 |
+
"exclude": ["node_modules", "public"]
|
10 |
+
}
|
laravel-sample/package-lock.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
laravel-sample/package.json
CHANGED
@@ -7,11 +7,19 @@
|
|
7 |
"dev": "vite"
|
8 |
},
|
9 |
"devDependencies": {
|
|
|
|
|
|
|
10 |
"@tailwindcss/vite": "^4.0.0",
|
|
|
|
|
11 |
"axios": "^1.8.2",
|
12 |
"concurrently": "^9.0.1",
|
13 |
"laravel-vite-plugin": "^1.2.0",
|
14 |
-
"
|
|
|
|
|
|
|
15 |
"vite": "^6.2.4"
|
16 |
}
|
17 |
}
|
|
|
7 |
"dev": "vite"
|
8 |
},
|
9 |
"devDependencies": {
|
10 |
+
"@headlessui/react": "^2.0.0",
|
11 |
+
"@inertiajs/react": "^2.0.0",
|
12 |
+
"@tailwindcss/forms": "^0.5.3",
|
13 |
"@tailwindcss/vite": "^4.0.0",
|
14 |
+
"@vitejs/plugin-react": "^4.2.0",
|
15 |
+
"autoprefixer": "^10.4.12",
|
16 |
"axios": "^1.8.2",
|
17 |
"concurrently": "^9.0.1",
|
18 |
"laravel-vite-plugin": "^1.2.0",
|
19 |
+
"postcss": "^8.4.31",
|
20 |
+
"react": "^18.2.0",
|
21 |
+
"react-dom": "^18.2.0",
|
22 |
+
"tailwindcss": "^3.2.1",
|
23 |
"vite": "^6.2.4"
|
24 |
}
|
25 |
}
|
laravel-sample/postcss.config.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default {
|
2 |
+
plugins: {
|
3 |
+
tailwindcss: {},
|
4 |
+
autoprefixer: {},
|
5 |
+
},
|
6 |
+
};
|
laravel-sample/resources/css/app.css
CHANGED
@@ -1,11 +1,3 @@
|
|
1 |
-
@
|
2 |
-
|
3 |
-
@
|
4 |
-
@source '../../storage/framework/views/*.php';
|
5 |
-
@source '../**/*.blade.php';
|
6 |
-
@source '../**/*.js';
|
7 |
-
|
8 |
-
@theme {
|
9 |
-
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
10 |
-
'Segoe UI Symbol', 'Noto Color Emoji';
|
11 |
-
}
|
|
|
1 |
+
@tailwind base;
|
2 |
+
@tailwind components;
|
3 |
+
@tailwind utilities;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
laravel-sample/resources/js/Components/ApplicationLogo.jsx
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function ApplicationLogo(props) {
|
2 |
+
return (
|
3 |
+
<svg
|
4 |
+
{...props}
|
5 |
+
viewBox="0 0 316 316"
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
>
|
8 |
+
<path 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" />
|
9 |
+
</svg>
|
10 |
+
);
|
11 |
+
}
|
laravel-sample/resources/js/Components/Checkbox.jsx
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function Checkbox({ className = '', ...props }) {
|
2 |
+
return (
|
3 |
+
<input
|
4 |
+
{...props}
|
5 |
+
type="checkbox"
|
6 |
+
className={
|
7 |
+
'rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 ' +
|
8 |
+
className
|
9 |
+
}
|
10 |
+
/>
|
11 |
+
);
|
12 |
+
}
|
laravel-sample/resources/js/Components/DangerButton.jsx
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function DangerButton({
|
2 |
+
className = '',
|
3 |
+
disabled,
|
4 |
+
children,
|
5 |
+
...props
|
6 |
+
}) {
|
7 |
+
return (
|
8 |
+
<button
|
9 |
+
{...props}
|
10 |
+
className={
|
11 |
+
`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 ${
|
12 |
+
disabled && 'opacity-25'
|
13 |
+
} ` + className
|
14 |
+
}
|
15 |
+
disabled={disabled}
|
16 |
+
>
|
17 |
+
{children}
|
18 |
+
</button>
|
19 |
+
);
|
20 |
+
}
|
laravel-sample/resources/js/Components/Dropdown.jsx
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Transition } from '@headlessui/react';
|
2 |
+
import { Link } from '@inertiajs/react';
|
3 |
+
import { createContext, useContext, useState } from 'react';
|
4 |
+
|
5 |
+
const DropDownContext = createContext();
|
6 |
+
|
7 |
+
const Dropdown = ({ children }) => {
|
8 |
+
const [open, setOpen] = useState(false);
|
9 |
+
|
10 |
+
const toggleOpen = () => {
|
11 |
+
setOpen((previousState) => !previousState);
|
12 |
+
};
|
13 |
+
|
14 |
+
return (
|
15 |
+
<DropDownContext.Provider value={{ open, setOpen, toggleOpen }}>
|
16 |
+
<div className="relative">{children}</div>
|
17 |
+
</DropDownContext.Provider>
|
18 |
+
);
|
19 |
+
};
|
20 |
+
|
21 |
+
const Trigger = ({ children }) => {
|
22 |
+
const { open, setOpen, toggleOpen } = useContext(DropDownContext);
|
23 |
+
|
24 |
+
return (
|
25 |
+
<>
|
26 |
+
<div onClick={toggleOpen}>{children}</div>
|
27 |
+
|
28 |
+
{open && (
|
29 |
+
<div
|
30 |
+
className="fixed inset-0 z-40"
|
31 |
+
onClick={() => setOpen(false)}
|
32 |
+
></div>
|
33 |
+
)}
|
34 |
+
</>
|
35 |
+
);
|
36 |
+
};
|
37 |
+
|
38 |
+
const Content = ({
|
39 |
+
align = 'right',
|
40 |
+
width = '48',
|
41 |
+
contentClasses = 'py-1 bg-white',
|
42 |
+
children,
|
43 |
+
}) => {
|
44 |
+
const { open, setOpen } = useContext(DropDownContext);
|
45 |
+
|
46 |
+
let alignmentClasses = 'origin-top';
|
47 |
+
|
48 |
+
if (align === 'left') {
|
49 |
+
alignmentClasses = 'ltr:origin-top-left rtl:origin-top-right start-0';
|
50 |
+
} else if (align === 'right') {
|
51 |
+
alignmentClasses = 'ltr:origin-top-right rtl:origin-top-left end-0';
|
52 |
+
}
|
53 |
+
|
54 |
+
let widthClasses = '';
|
55 |
+
|
56 |
+
if (width === '48') {
|
57 |
+
widthClasses = 'w-48';
|
58 |
+
}
|
59 |
+
|
60 |
+
return (
|
61 |
+
<>
|
62 |
+
<Transition
|
63 |
+
show={open}
|
64 |
+
enter="transition ease-out duration-200"
|
65 |
+
enterFrom="opacity-0 scale-95"
|
66 |
+
enterTo="opacity-100 scale-100"
|
67 |
+
leave="transition ease-in duration-75"
|
68 |
+
leaveFrom="opacity-100 scale-100"
|
69 |
+
leaveTo="opacity-0 scale-95"
|
70 |
+
>
|
71 |
+
<div
|
72 |
+
className={`absolute z-50 mt-2 rounded-md shadow-lg ${alignmentClasses} ${widthClasses}`}
|
73 |
+
onClick={() => setOpen(false)}
|
74 |
+
>
|
75 |
+
<div
|
76 |
+
className={
|
77 |
+
`rounded-md ring-1 ring-black ring-opacity-5 ` +
|
78 |
+
contentClasses
|
79 |
+
}
|
80 |
+
>
|
81 |
+
{children}
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
</Transition>
|
85 |
+
</>
|
86 |
+
);
|
87 |
+
};
|
88 |
+
|
89 |
+
const DropdownLink = ({ className = '', children, ...props }) => {
|
90 |
+
return (
|
91 |
+
<Link
|
92 |
+
{...props}
|
93 |
+
className={
|
94 |
+
'block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 transition duration-150 ease-in-out hover:bg-gray-100 focus:bg-gray-100 focus:outline-none ' +
|
95 |
+
className
|
96 |
+
}
|
97 |
+
>
|
98 |
+
{children}
|
99 |
+
</Link>
|
100 |
+
);
|
101 |
+
};
|
102 |
+
|
103 |
+
Dropdown.Trigger = Trigger;
|
104 |
+
Dropdown.Content = Content;
|
105 |
+
Dropdown.Link = DropdownLink;
|
106 |
+
|
107 |
+
export default Dropdown;
|
laravel-sample/resources/js/Components/InputError.jsx
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function InputError({ message, className = '', ...props }) {
|
2 |
+
return message ? (
|
3 |
+
<p
|
4 |
+
{...props}
|
5 |
+
className={'text-sm text-red-600 ' + className}
|
6 |
+
>
|
7 |
+
{message}
|
8 |
+
</p>
|
9 |
+
) : null;
|
10 |
+
}
|
laravel-sample/resources/js/Components/InputLabel.jsx
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function InputLabel({
|
2 |
+
value,
|
3 |
+
className = '',
|
4 |
+
children,
|
5 |
+
...props
|
6 |
+
}) {
|
7 |
+
return (
|
8 |
+
<label
|
9 |
+
{...props}
|
10 |
+
className={
|
11 |
+
`block text-sm font-medium text-gray-700 ` +
|
12 |
+
className
|
13 |
+
}
|
14 |
+
>
|
15 |
+
{value ? value : children}
|
16 |
+
</label>
|
17 |
+
);
|
18 |
+
}
|
laravel-sample/resources/js/Components/Modal.jsx
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import {
|
2 |
+
Dialog,
|
3 |
+
DialogPanel,
|
4 |
+
Transition,
|
5 |
+
TransitionChild,
|
6 |
+
} from '@headlessui/react';
|
7 |
+
|
8 |
+
export default function Modal({
|
9 |
+
children,
|
10 |
+
show = false,
|
11 |
+
maxWidth = '2xl',
|
12 |
+
closeable = true,
|
13 |
+
onClose = () => {},
|
14 |
+
}) {
|
15 |
+
const close = () => {
|
16 |
+
if (closeable) {
|
17 |
+
onClose();
|
18 |
+
}
|
19 |
+
};
|
20 |
+
|
21 |
+
const maxWidthClass = {
|
22 |
+
sm: 'sm:max-w-sm',
|
23 |
+
md: 'sm:max-w-md',
|
24 |
+
lg: 'sm:max-w-lg',
|
25 |
+
xl: 'sm:max-w-xl',
|
26 |
+
'2xl': 'sm:max-w-2xl',
|
27 |
+
}[maxWidth];
|
28 |
+
|
29 |
+
return (
|
30 |
+
<Transition show={show} leave="duration-200">
|
31 |
+
<Dialog
|
32 |
+
as="div"
|
33 |
+
id="modal"
|
34 |
+
className="fixed inset-0 z-50 flex transform items-center overflow-y-auto px-4 py-6 transition-all sm:px-0"
|
35 |
+
onClose={close}
|
36 |
+
>
|
37 |
+
<TransitionChild
|
38 |
+
enter="ease-out duration-300"
|
39 |
+
enterFrom="opacity-0"
|
40 |
+
enterTo="opacity-100"
|
41 |
+
leave="ease-in duration-200"
|
42 |
+
leaveFrom="opacity-100"
|
43 |
+
leaveTo="opacity-0"
|
44 |
+
>
|
45 |
+
<div className="absolute inset-0 bg-gray-500/75" />
|
46 |
+
</TransitionChild>
|
47 |
+
|
48 |
+
<TransitionChild
|
49 |
+
enter="ease-out duration-300"
|
50 |
+
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
51 |
+
enterTo="opacity-100 translate-y-0 sm:scale-100"
|
52 |
+
leave="ease-in duration-200"
|
53 |
+
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
|
54 |
+
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
55 |
+
>
|
56 |
+
<DialogPanel
|
57 |
+
className={`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full ${maxWidthClass}`}
|
58 |
+
>
|
59 |
+
{children}
|
60 |
+
</DialogPanel>
|
61 |
+
</TransitionChild>
|
62 |
+
</Dialog>
|
63 |
+
</Transition>
|
64 |
+
);
|
65 |
+
}
|
laravel-sample/resources/js/Components/NavLink.jsx
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Link } from '@inertiajs/react';
|
2 |
+
|
3 |
+
export default function NavLink({
|
4 |
+
active = false,
|
5 |
+
className = '',
|
6 |
+
children,
|
7 |
+
...props
|
8 |
+
}) {
|
9 |
+
return (
|
10 |
+
<Link
|
11 |
+
{...props}
|
12 |
+
className={
|
13 |
+
'inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium leading-5 transition duration-150 ease-in-out focus:outline-none ' +
|
14 |
+
(active
|
15 |
+
? 'border-indigo-400 text-gray-900 focus:border-indigo-700'
|
16 |
+
: 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 focus:border-gray-300 focus:text-gray-700') +
|
17 |
+
className
|
18 |
+
}
|
19 |
+
>
|
20 |
+
{children}
|
21 |
+
</Link>
|
22 |
+
);
|
23 |
+
}
|
laravel-sample/resources/js/Components/PrimaryButton.jsx
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function PrimaryButton({
|
2 |
+
className = '',
|
3 |
+
disabled,
|
4 |
+
children,
|
5 |
+
...props
|
6 |
+
}) {
|
7 |
+
return (
|
8 |
+
<button
|
9 |
+
{...props}
|
10 |
+
className={
|
11 |
+
`inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 active:bg-gray-900 ${
|
12 |
+
disabled && 'opacity-25'
|
13 |
+
} ` + className
|
14 |
+
}
|
15 |
+
disabled={disabled}
|
16 |
+
>
|
17 |
+
{children}
|
18 |
+
</button>
|
19 |
+
);
|
20 |
+
}
|
laravel-sample/resources/js/Components/ResponsiveNavLink.jsx
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Link } from '@inertiajs/react';
|
2 |
+
|
3 |
+
export default function ResponsiveNavLink({
|
4 |
+
active = false,
|
5 |
+
className = '',
|
6 |
+
children,
|
7 |
+
...props
|
8 |
+
}) {
|
9 |
+
return (
|
10 |
+
<Link
|
11 |
+
{...props}
|
12 |
+
className={`flex w-full items-start border-l-4 py-2 pe-4 ps-3 ${
|
13 |
+
active
|
14 |
+
? 'border-indigo-400 bg-indigo-50 text-indigo-700 focus:border-indigo-700 focus:bg-indigo-100 focus:text-indigo-800'
|
15 |
+
: 'border-transparent text-gray-600 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-800 focus:border-gray-300 focus:bg-gray-50 focus:text-gray-800'
|
16 |
+
} text-base font-medium transition duration-150 ease-in-out focus:outline-none ${className}`}
|
17 |
+
>
|
18 |
+
{children}
|
19 |
+
</Link>
|
20 |
+
);
|
21 |
+
}
|
laravel-sample/resources/js/Components/SecondaryButton.jsx
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function SecondaryButton({
|
2 |
+
type = 'button',
|
3 |
+
className = '',
|
4 |
+
disabled,
|
5 |
+
children,
|
6 |
+
...props
|
7 |
+
}) {
|
8 |
+
return (
|
9 |
+
<button
|
10 |
+
{...props}
|
11 |
+
type={type}
|
12 |
+
className={
|
13 |
+
`inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-xs font-semibold uppercase tracking-widest text-gray-700 shadow-sm transition duration-150 ease-in-out hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-25 ${
|
14 |
+
disabled && 'opacity-25'
|
15 |
+
} ` + className
|
16 |
+
}
|
17 |
+
disabled={disabled}
|
18 |
+
>
|
19 |
+
{children}
|
20 |
+
</button>
|
21 |
+
);
|
22 |
+
}
|
laravel-sample/resources/js/Components/TextInput.jsx
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
2 |
+
|
3 |
+
export default forwardRef(function TextInput(
|
4 |
+
{ type = 'text', className = '', isFocused = false, ...props },
|
5 |
+
ref,
|
6 |
+
) {
|
7 |
+
const localRef = useRef(null);
|
8 |
+
|
9 |
+
useImperativeHandle(ref, () => ({
|
10 |
+
focus: () => localRef.current?.focus(),
|
11 |
+
}));
|
12 |
+
|
13 |
+
useEffect(() => {
|
14 |
+
if (isFocused) {
|
15 |
+
localRef.current?.focus();
|
16 |
+
}
|
17 |
+
}, [isFocused]);
|
18 |
+
|
19 |
+
return (
|
20 |
+
<input
|
21 |
+
{...props}
|
22 |
+
type={type}
|
23 |
+
className={
|
24 |
+
'rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 ' +
|
25 |
+
className
|
26 |
+
}
|
27 |
+
ref={localRef}
|
28 |
+
/>
|
29 |
+
);
|
30 |
+
});
|
laravel-sample/resources/js/Layouts/AuthenticatedLayout.jsx
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ApplicationLogo from '@/Components/ApplicationLogo';
|
2 |
+
import Dropdown from '@/Components/Dropdown';
|
3 |
+
import NavLink from '@/Components/NavLink';
|
4 |
+
import ResponsiveNavLink from '@/Components/ResponsiveNavLink';
|
5 |
+
import { Link, usePage } from '@inertiajs/react';
|
6 |
+
import { useState } from 'react';
|
7 |
+
|
8 |
+
export default function AuthenticatedLayout({ header, children }) {
|
9 |
+
const user = usePage().props.auth.user;
|
10 |
+
|
11 |
+
const [showingNavigationDropdown, setShowingNavigationDropdown] =
|
12 |
+
useState(false);
|
13 |
+
|
14 |
+
return (
|
15 |
+
<div className="min-h-screen bg-gray-100">
|
16 |
+
<nav className="border-b border-gray-100 bg-white">
|
17 |
+
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
18 |
+
<div className="flex h-16 justify-between">
|
19 |
+
<div className="flex">
|
20 |
+
<div className="flex shrink-0 items-center">
|
21 |
+
<Link href="/">
|
22 |
+
<ApplicationLogo className="block h-9 w-auto fill-current text-gray-800" />
|
23 |
+
</Link>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div className="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
27 |
+
<NavLink
|
28 |
+
href={route('dashboard')}
|
29 |
+
active={route().current('dashboard')}
|
30 |
+
>
|
31 |
+
Dashboard
|
32 |
+
</NavLink>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div className="hidden sm:ms-6 sm:flex sm:items-center">
|
37 |
+
<div className="relative ms-3">
|
38 |
+
<Dropdown>
|
39 |
+
<Dropdown.Trigger>
|
40 |
+
<span className="inline-flex rounded-md">
|
41 |
+
<button
|
42 |
+
type="button"
|
43 |
+
className="inline-flex items-center rounded-md border border-transparent bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-500 transition duration-150 ease-in-out hover:text-gray-700 focus:outline-none"
|
44 |
+
>
|
45 |
+
{user.name}
|
46 |
+
|
47 |
+
<svg
|
48 |
+
className="-me-0.5 ms-2 h-4 w-4"
|
49 |
+
xmlns="http://www.w3.org/2000/svg"
|
50 |
+
viewBox="0 0 20 20"
|
51 |
+
fill="currentColor"
|
52 |
+
>
|
53 |
+
<path
|
54 |
+
fillRule="evenodd"
|
55 |
+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
56 |
+
clipRule="evenodd"
|
57 |
+
/>
|
58 |
+
</svg>
|
59 |
+
</button>
|
60 |
+
</span>
|
61 |
+
</Dropdown.Trigger>
|
62 |
+
|
63 |
+
<Dropdown.Content>
|
64 |
+
<Dropdown.Link
|
65 |
+
href={route('profile.edit')}
|
66 |
+
>
|
67 |
+
Profile
|
68 |
+
</Dropdown.Link>
|
69 |
+
<Dropdown.Link
|
70 |
+
href={route('logout')}
|
71 |
+
method="post"
|
72 |
+
as="button"
|
73 |
+
>
|
74 |
+
Log Out
|
75 |
+
</Dropdown.Link>
|
76 |
+
</Dropdown.Content>
|
77 |
+
</Dropdown>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
<div className="-me-2 flex items-center sm:hidden">
|
82 |
+
<button
|
83 |
+
onClick={() =>
|
84 |
+
setShowingNavigationDropdown(
|
85 |
+
(previousState) => !previousState,
|
86 |
+
)
|
87 |
+
}
|
88 |
+
className="inline-flex items-center justify-center rounded-md p-2 text-gray-400 transition duration-150 ease-in-out hover:bg-gray-100 hover:text-gray-500 focus:bg-gray-100 focus:text-gray-500 focus:outline-none"
|
89 |
+
>
|
90 |
+
<svg
|
91 |
+
className="h-6 w-6"
|
92 |
+
stroke="currentColor"
|
93 |
+
fill="none"
|
94 |
+
viewBox="0 0 24 24"
|
95 |
+
>
|
96 |
+
<path
|
97 |
+
className={
|
98 |
+
!showingNavigationDropdown
|
99 |
+
? 'inline-flex'
|
100 |
+
: 'hidden'
|
101 |
+
}
|
102 |
+
strokeLinecap="round"
|
103 |
+
strokeLinejoin="round"
|
104 |
+
strokeWidth="2"
|
105 |
+
d="M4 6h16M4 12h16M4 18h16"
|
106 |
+
/>
|
107 |
+
<path
|
108 |
+
className={
|
109 |
+
showingNavigationDropdown
|
110 |
+
? 'inline-flex'
|
111 |
+
: 'hidden'
|
112 |
+
}
|
113 |
+
strokeLinecap="round"
|
114 |
+
strokeLinejoin="round"
|
115 |
+
strokeWidth="2"
|
116 |
+
d="M6 18L18 6M6 6l12 12"
|
117 |
+
/>
|
118 |
+
</svg>
|
119 |
+
</button>
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
<div
|
125 |
+
className={
|
126 |
+
(showingNavigationDropdown ? 'block' : 'hidden') +
|
127 |
+
' sm:hidden'
|
128 |
+
}
|
129 |
+
>
|
130 |
+
<div className="space-y-1 pb-3 pt-2">
|
131 |
+
<ResponsiveNavLink
|
132 |
+
href={route('dashboard')}
|
133 |
+
active={route().current('dashboard')}
|
134 |
+
>
|
135 |
+
Dashboard
|
136 |
+
</ResponsiveNavLink>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
<div className="border-t border-gray-200 pb-1 pt-4">
|
140 |
+
<div className="px-4">
|
141 |
+
<div className="text-base font-medium text-gray-800">
|
142 |
+
{user.name}
|
143 |
+
</div>
|
144 |
+
<div className="text-sm font-medium text-gray-500">
|
145 |
+
{user.email}
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div className="mt-3 space-y-1">
|
150 |
+
<ResponsiveNavLink href={route('profile.edit')}>
|
151 |
+
Profile
|
152 |
+
</ResponsiveNavLink>
|
153 |
+
<ResponsiveNavLink
|
154 |
+
method="post"
|
155 |
+
href={route('logout')}
|
156 |
+
as="button"
|
157 |
+
>
|
158 |
+
Log Out
|
159 |
+
</ResponsiveNavLink>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
</nav>
|
164 |
+
|
165 |
+
{header && (
|
166 |
+
<header className="bg-white shadow">
|
167 |
+
<div className="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
|
168 |
+
{header}
|
169 |
+
</div>
|
170 |
+
</header>
|
171 |
+
)}
|
172 |
+
|
173 |
+
<main>{children}</main>
|
174 |
+
</div>
|
175 |
+
);
|
176 |
+
}
|
laravel-sample/resources/js/Layouts/GuestLayout.jsx
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ApplicationLogo from '@/Components/ApplicationLogo';
|
2 |
+
import { Link } from '@inertiajs/react';
|
3 |
+
|
4 |
+
export default function GuestLayout({ children }) {
|
5 |
+
return (
|
6 |
+
<div className="flex min-h-screen flex-col items-center bg-gray-100 pt-6 sm:justify-center sm:pt-0">
|
7 |
+
<div>
|
8 |
+
<Link href="/">
|
9 |
+
<ApplicationLogo className="h-20 w-20 fill-current text-gray-500" />
|
10 |
+
</Link>
|
11 |
+
</div>
|
12 |
+
|
13 |
+
<div className="mt-6 w-full overflow-hidden bg-white px-6 py-4 shadow-md sm:max-w-md sm:rounded-lg">
|
14 |
+
{children}
|
15 |
+
</div>
|
16 |
+
</div>
|
17 |
+
);
|
18 |
+
}
|
laravel-sample/resources/js/Pages/Auth/ConfirmPassword.jsx
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import InputError from '@/Components/InputError';
|
2 |
+
import InputLabel from '@/Components/InputLabel';
|
3 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
4 |
+
import TextInput from '@/Components/TextInput';
|
5 |
+
import GuestLayout from '@/Layouts/GuestLayout';
|
6 |
+
import { Head, useForm } from '@inertiajs/react';
|
7 |
+
|
8 |
+
export default function ConfirmPassword() {
|
9 |
+
const { data, setData, post, processing, errors, reset } = useForm({
|
10 |
+
password: '',
|
11 |
+
});
|
12 |
+
|
13 |
+
const submit = (e) => {
|
14 |
+
e.preventDefault();
|
15 |
+
|
16 |
+
post(route('password.confirm'), {
|
17 |
+
onFinish: () => reset('password'),
|
18 |
+
});
|
19 |
+
};
|
20 |
+
|
21 |
+
return (
|
22 |
+
<GuestLayout>
|
23 |
+
<Head title="Confirm Password" />
|
24 |
+
|
25 |
+
<div className="mb-4 text-sm text-gray-600">
|
26 |
+
This is a secure area of the application. Please confirm your
|
27 |
+
password before continuing.
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<form onSubmit={submit}>
|
31 |
+
<div className="mt-4">
|
32 |
+
<InputLabel htmlFor="password" value="Password" />
|
33 |
+
|
34 |
+
<TextInput
|
35 |
+
id="password"
|
36 |
+
type="password"
|
37 |
+
name="password"
|
38 |
+
value={data.password}
|
39 |
+
className="mt-1 block w-full"
|
40 |
+
isFocused={true}
|
41 |
+
onChange={(e) => setData('password', e.target.value)}
|
42 |
+
/>
|
43 |
+
|
44 |
+
<InputError message={errors.password} className="mt-2" />
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<div className="mt-4 flex items-center justify-end">
|
48 |
+
<PrimaryButton className="ms-4" disabled={processing}>
|
49 |
+
Confirm
|
50 |
+
</PrimaryButton>
|
51 |
+
</div>
|
52 |
+
</form>
|
53 |
+
</GuestLayout>
|
54 |
+
);
|
55 |
+
}
|
laravel-sample/resources/js/Pages/Auth/ForgotPassword.jsx
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import InputError from '@/Components/InputError';
|
2 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
3 |
+
import TextInput from '@/Components/TextInput';
|
4 |
+
import GuestLayout from '@/Layouts/GuestLayout';
|
5 |
+
import { Head, useForm } from '@inertiajs/react';
|
6 |
+
|
7 |
+
export default function ForgotPassword({ status }) {
|
8 |
+
const { data, setData, post, processing, errors } = useForm({
|
9 |
+
email: '',
|
10 |
+
});
|
11 |
+
|
12 |
+
const submit = (e) => {
|
13 |
+
e.preventDefault();
|
14 |
+
|
15 |
+
post(route('password.email'));
|
16 |
+
};
|
17 |
+
|
18 |
+
return (
|
19 |
+
<GuestLayout>
|
20 |
+
<Head title="Forgot Password" />
|
21 |
+
|
22 |
+
<div className="mb-4 text-sm text-gray-600">
|
23 |
+
Forgot your password? No problem. Just let us know your email
|
24 |
+
address and we will email you a password reset link that will
|
25 |
+
allow you to choose a new one.
|
26 |
+
</div>
|
27 |
+
|
28 |
+
{status && (
|
29 |
+
<div className="mb-4 text-sm font-medium text-green-600">
|
30 |
+
{status}
|
31 |
+
</div>
|
32 |
+
)}
|
33 |
+
|
34 |
+
<form onSubmit={submit}>
|
35 |
+
<TextInput
|
36 |
+
id="email"
|
37 |
+
type="email"
|
38 |
+
name="email"
|
39 |
+
value={data.email}
|
40 |
+
className="mt-1 block w-full"
|
41 |
+
isFocused={true}
|
42 |
+
onChange={(e) => setData('email', e.target.value)}
|
43 |
+
/>
|
44 |
+
|
45 |
+
<InputError message={errors.email} className="mt-2" />
|
46 |
+
|
47 |
+
<div className="mt-4 flex items-center justify-end">
|
48 |
+
<PrimaryButton className="ms-4" disabled={processing}>
|
49 |
+
Email Password Reset Link
|
50 |
+
</PrimaryButton>
|
51 |
+
</div>
|
52 |
+
</form>
|
53 |
+
</GuestLayout>
|
54 |
+
);
|
55 |
+
}
|
laravel-sample/resources/js/Pages/Auth/Login.jsx
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Checkbox from '@/Components/Checkbox';
|
2 |
+
import InputError from '@/Components/InputError';
|
3 |
+
import InputLabel from '@/Components/InputLabel';
|
4 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
5 |
+
import TextInput from '@/Components/TextInput';
|
6 |
+
import GuestLayout from '@/Layouts/GuestLayout';
|
7 |
+
import { Head, Link, useForm } from '@inertiajs/react';
|
8 |
+
|
9 |
+
export default function Login({ status, canResetPassword }) {
|
10 |
+
const { data, setData, post, processing, errors, reset } = useForm({
|
11 |
+
email: '',
|
12 |
+
password: '',
|
13 |
+
remember: false,
|
14 |
+
});
|
15 |
+
|
16 |
+
const submit = (e) => {
|
17 |
+
e.preventDefault();
|
18 |
+
|
19 |
+
post(route('login'), {
|
20 |
+
onFinish: () => reset('password'),
|
21 |
+
});
|
22 |
+
};
|
23 |
+
|
24 |
+
return (
|
25 |
+
<GuestLayout>
|
26 |
+
<Head title="Log in" />
|
27 |
+
|
28 |
+
{status && (
|
29 |
+
<div className="mb-4 text-sm font-medium text-green-600">
|
30 |
+
{status}
|
31 |
+
</div>
|
32 |
+
)}
|
33 |
+
|
34 |
+
<form onSubmit={submit}>
|
35 |
+
<div>
|
36 |
+
<InputLabel htmlFor="email" value="Email" />
|
37 |
+
|
38 |
+
<TextInput
|
39 |
+
id="email"
|
40 |
+
type="email"
|
41 |
+
name="email"
|
42 |
+
value={data.email}
|
43 |
+
className="mt-1 block w-full"
|
44 |
+
autoComplete="username"
|
45 |
+
isFocused={true}
|
46 |
+
onChange={(e) => setData('email', e.target.value)}
|
47 |
+
/>
|
48 |
+
|
49 |
+
<InputError message={errors.email} className="mt-2" />
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<div className="mt-4">
|
53 |
+
<InputLabel htmlFor="password" value="Password" />
|
54 |
+
|
55 |
+
<TextInput
|
56 |
+
id="password"
|
57 |
+
type="password"
|
58 |
+
name="password"
|
59 |
+
value={data.password}
|
60 |
+
className="mt-1 block w-full"
|
61 |
+
autoComplete="current-password"
|
62 |
+
onChange={(e) => setData('password', e.target.value)}
|
63 |
+
/>
|
64 |
+
|
65 |
+
<InputError message={errors.password} className="mt-2" />
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<div className="mt-4 block">
|
69 |
+
<label className="flex items-center">
|
70 |
+
<Checkbox
|
71 |
+
name="remember"
|
72 |
+
checked={data.remember}
|
73 |
+
onChange={(e) =>
|
74 |
+
setData('remember', e.target.checked)
|
75 |
+
}
|
76 |
+
/>
|
77 |
+
<span className="ms-2 text-sm text-gray-600">
|
78 |
+
Remember me
|
79 |
+
</span>
|
80 |
+
</label>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div className="mt-4 flex items-center justify-end">
|
84 |
+
{canResetPassword && (
|
85 |
+
<Link
|
86 |
+
href={route('password.request')}
|
87 |
+
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
88 |
+
>
|
89 |
+
Forgot your password?
|
90 |
+
</Link>
|
91 |
+
)}
|
92 |
+
|
93 |
+
<PrimaryButton className="ms-4" disabled={processing}>
|
94 |
+
Log in
|
95 |
+
</PrimaryButton>
|
96 |
+
</div>
|
97 |
+
</form>
|
98 |
+
</GuestLayout>
|
99 |
+
);
|
100 |
+
}
|
laravel-sample/resources/js/Pages/Auth/Register.jsx
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import InputError from '@/Components/InputError';
|
2 |
+
import InputLabel from '@/Components/InputLabel';
|
3 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
4 |
+
import TextInput from '@/Components/TextInput';
|
5 |
+
import GuestLayout from '@/Layouts/GuestLayout';
|
6 |
+
import { Head, Link, useForm } from '@inertiajs/react';
|
7 |
+
|
8 |
+
export default function Register() {
|
9 |
+
const { data, setData, post, processing, errors, reset } = useForm({
|
10 |
+
name: '',
|
11 |
+
email: '',
|
12 |
+
password: '',
|
13 |
+
password_confirmation: '',
|
14 |
+
});
|
15 |
+
|
16 |
+
const submit = (e) => {
|
17 |
+
e.preventDefault();
|
18 |
+
|
19 |
+
post(route('register'), {
|
20 |
+
onFinish: () => reset('password', 'password_confirmation'),
|
21 |
+
});
|
22 |
+
};
|
23 |
+
|
24 |
+
return (
|
25 |
+
<GuestLayout>
|
26 |
+
<Head title="Register" />
|
27 |
+
|
28 |
+
<form onSubmit={submit}>
|
29 |
+
<div>
|
30 |
+
<InputLabel htmlFor="name" value="Name" />
|
31 |
+
|
32 |
+
<TextInput
|
33 |
+
id="name"
|
34 |
+
name="name"
|
35 |
+
value={data.name}
|
36 |
+
className="mt-1 block w-full"
|
37 |
+
autoComplete="name"
|
38 |
+
isFocused={true}
|
39 |
+
onChange={(e) => setData('name', e.target.value)}
|
40 |
+
required
|
41 |
+
/>
|
42 |
+
|
43 |
+
<InputError message={errors.name} className="mt-2" />
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div className="mt-4">
|
47 |
+
<InputLabel htmlFor="email" value="Email" />
|
48 |
+
|
49 |
+
<TextInput
|
50 |
+
id="email"
|
51 |
+
type="email"
|
52 |
+
name="email"
|
53 |
+
value={data.email}
|
54 |
+
className="mt-1 block w-full"
|
55 |
+
autoComplete="username"
|
56 |
+
onChange={(e) => setData('email', e.target.value)}
|
57 |
+
required
|
58 |
+
/>
|
59 |
+
|
60 |
+
<InputError message={errors.email} className="mt-2" />
|
61 |
+
</div>
|
62 |
+
|
63 |
+
<div className="mt-4">
|
64 |
+
<InputLabel htmlFor="password" value="Password" />
|
65 |
+
|
66 |
+
<TextInput
|
67 |
+
id="password"
|
68 |
+
type="password"
|
69 |
+
name="password"
|
70 |
+
value={data.password}
|
71 |
+
className="mt-1 block w-full"
|
72 |
+
autoComplete="new-password"
|
73 |
+
onChange={(e) => setData('password', e.target.value)}
|
74 |
+
required
|
75 |
+
/>
|
76 |
+
|
77 |
+
<InputError message={errors.password} className="mt-2" />
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<div className="mt-4">
|
81 |
+
<InputLabel
|
82 |
+
htmlFor="password_confirmation"
|
83 |
+
value="Confirm Password"
|
84 |
+
/>
|
85 |
+
|
86 |
+
<TextInput
|
87 |
+
id="password_confirmation"
|
88 |
+
type="password"
|
89 |
+
name="password_confirmation"
|
90 |
+
value={data.password_confirmation}
|
91 |
+
className="mt-1 block w-full"
|
92 |
+
autoComplete="new-password"
|
93 |
+
onChange={(e) =>
|
94 |
+
setData('password_confirmation', e.target.value)
|
95 |
+
}
|
96 |
+
required
|
97 |
+
/>
|
98 |
+
|
99 |
+
<InputError
|
100 |
+
message={errors.password_confirmation}
|
101 |
+
className="mt-2"
|
102 |
+
/>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<div className="mt-4 flex items-center justify-end">
|
106 |
+
<Link
|
107 |
+
href={route('login')}
|
108 |
+
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
109 |
+
>
|
110 |
+
Already registered?
|
111 |
+
</Link>
|
112 |
+
|
113 |
+
<PrimaryButton className="ms-4" disabled={processing}>
|
114 |
+
Register
|
115 |
+
</PrimaryButton>
|
116 |
+
</div>
|
117 |
+
</form>
|
118 |
+
</GuestLayout>
|
119 |
+
);
|
120 |
+
}
|
laravel-sample/resources/js/Pages/Auth/ResetPassword.jsx
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import InputError from '@/Components/InputError';
|
2 |
+
import InputLabel from '@/Components/InputLabel';
|
3 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
4 |
+
import TextInput from '@/Components/TextInput';
|
5 |
+
import GuestLayout from '@/Layouts/GuestLayout';
|
6 |
+
import { Head, useForm } from '@inertiajs/react';
|
7 |
+
|
8 |
+
export default function ResetPassword({ token, email }) {
|
9 |
+
const { data, setData, post, processing, errors, reset } = useForm({
|
10 |
+
token: token,
|
11 |
+
email: email,
|
12 |
+
password: '',
|
13 |
+
password_confirmation: '',
|
14 |
+
});
|
15 |
+
|
16 |
+
const submit = (e) => {
|
17 |
+
e.preventDefault();
|
18 |
+
|
19 |
+
post(route('password.store'), {
|
20 |
+
onFinish: () => reset('password', 'password_confirmation'),
|
21 |
+
});
|
22 |
+
};
|
23 |
+
|
24 |
+
return (
|
25 |
+
<GuestLayout>
|
26 |
+
<Head title="Reset Password" />
|
27 |
+
|
28 |
+
<form onSubmit={submit}>
|
29 |
+
<div>
|
30 |
+
<InputLabel htmlFor="email" value="Email" />
|
31 |
+
|
32 |
+
<TextInput
|
33 |
+
id="email"
|
34 |
+
type="email"
|
35 |
+
name="email"
|
36 |
+
value={data.email}
|
37 |
+
className="mt-1 block w-full"
|
38 |
+
autoComplete="username"
|
39 |
+
onChange={(e) => setData('email', e.target.value)}
|
40 |
+
/>
|
41 |
+
|
42 |
+
<InputError message={errors.email} className="mt-2" />
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<div className="mt-4">
|
46 |
+
<InputLabel htmlFor="password" value="Password" />
|
47 |
+
|
48 |
+
<TextInput
|
49 |
+
id="password"
|
50 |
+
type="password"
|
51 |
+
name="password"
|
52 |
+
value={data.password}
|
53 |
+
className="mt-1 block w-full"
|
54 |
+
autoComplete="new-password"
|
55 |
+
isFocused={true}
|
56 |
+
onChange={(e) => setData('password', e.target.value)}
|
57 |
+
/>
|
58 |
+
|
59 |
+
<InputError message={errors.password} className="mt-2" />
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<div className="mt-4">
|
63 |
+
<InputLabel
|
64 |
+
htmlFor="password_confirmation"
|
65 |
+
value="Confirm Password"
|
66 |
+
/>
|
67 |
+
|
68 |
+
<TextInput
|
69 |
+
type="password"
|
70 |
+
id="password_confirmation"
|
71 |
+
name="password_confirmation"
|
72 |
+
value={data.password_confirmation}
|
73 |
+
className="mt-1 block w-full"
|
74 |
+
autoComplete="new-password"
|
75 |
+
onChange={(e) =>
|
76 |
+
setData('password_confirmation', e.target.value)
|
77 |
+
}
|
78 |
+
/>
|
79 |
+
|
80 |
+
<InputError
|
81 |
+
message={errors.password_confirmation}
|
82 |
+
className="mt-2"
|
83 |
+
/>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
<div className="mt-4 flex items-center justify-end">
|
87 |
+
<PrimaryButton className="ms-4" disabled={processing}>
|
88 |
+
Reset Password
|
89 |
+
</PrimaryButton>
|
90 |
+
</div>
|
91 |
+
</form>
|
92 |
+
</GuestLayout>
|
93 |
+
);
|
94 |
+
}
|
laravel-sample/resources/js/Pages/Auth/VerifyEmail.jsx
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
2 |
+
import GuestLayout from '@/Layouts/GuestLayout';
|
3 |
+
import { Head, Link, useForm } from '@inertiajs/react';
|
4 |
+
|
5 |
+
export default function VerifyEmail({ status }) {
|
6 |
+
const { post, processing } = useForm({});
|
7 |
+
|
8 |
+
const submit = (e) => {
|
9 |
+
e.preventDefault();
|
10 |
+
|
11 |
+
post(route('verification.send'));
|
12 |
+
};
|
13 |
+
|
14 |
+
return (
|
15 |
+
<GuestLayout>
|
16 |
+
<Head title="Email Verification" />
|
17 |
+
|
18 |
+
<div className="mb-4 text-sm text-gray-600">
|
19 |
+
Thanks for signing up! Before getting started, could you verify
|
20 |
+
your email address by clicking on the link we just emailed to
|
21 |
+
you? If you didn't receive the email, we will gladly send you
|
22 |
+
another.
|
23 |
+
</div>
|
24 |
+
|
25 |
+
{status === 'verification-link-sent' && (
|
26 |
+
<div className="mb-4 text-sm font-medium text-green-600">
|
27 |
+
A new verification link has been sent to the email address
|
28 |
+
you provided during registration.
|
29 |
+
</div>
|
30 |
+
)}
|
31 |
+
|
32 |
+
<form onSubmit={submit}>
|
33 |
+
<div className="mt-4 flex items-center justify-between">
|
34 |
+
<PrimaryButton disabled={processing}>
|
35 |
+
Resend Verification Email
|
36 |
+
</PrimaryButton>
|
37 |
+
|
38 |
+
<Link
|
39 |
+
href={route('logout')}
|
40 |
+
method="post"
|
41 |
+
as="button"
|
42 |
+
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
43 |
+
>
|
44 |
+
Log Out
|
45 |
+
</Link>
|
46 |
+
</div>
|
47 |
+
</form>
|
48 |
+
</GuestLayout>
|
49 |
+
);
|
50 |
+
}
|
laravel-sample/resources/js/Pages/Dashboard.jsx
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
|
2 |
+
import { Head } from '@inertiajs/react';
|
3 |
+
|
4 |
+
export default function Dashboard() {
|
5 |
+
return (
|
6 |
+
<AuthenticatedLayout
|
7 |
+
header={
|
8 |
+
<h2 className="text-xl font-semibold leading-tight text-gray-800">
|
9 |
+
Dashboard
|
10 |
+
</h2>
|
11 |
+
}
|
12 |
+
>
|
13 |
+
<Head title="Dashboard" />
|
14 |
+
|
15 |
+
<div className="py-12">
|
16 |
+
<div className="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
17 |
+
<div className="overflow-hidden bg-white shadow-sm sm:rounded-lg">
|
18 |
+
<div className="p-6 text-gray-900">
|
19 |
+
You're logged in!
|
20 |
+
</div>
|
21 |
+
</div>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
</AuthenticatedLayout>
|
25 |
+
);
|
26 |
+
}
|
laravel-sample/resources/js/Pages/Profile/Edit.jsx
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
|
2 |
+
import { Head } from '@inertiajs/react';
|
3 |
+
import DeleteUserForm from './Partials/DeleteUserForm';
|
4 |
+
import UpdatePasswordForm from './Partials/UpdatePasswordForm';
|
5 |
+
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm';
|
6 |
+
|
7 |
+
export default function Edit({ mustVerifyEmail, status }) {
|
8 |
+
return (
|
9 |
+
<AuthenticatedLayout
|
10 |
+
header={
|
11 |
+
<h2 className="text-xl font-semibold leading-tight text-gray-800">
|
12 |
+
Profile
|
13 |
+
</h2>
|
14 |
+
}
|
15 |
+
>
|
16 |
+
<Head title="Profile" />
|
17 |
+
|
18 |
+
<div className="py-12">
|
19 |
+
<div className="mx-auto max-w-7xl space-y-6 sm:px-6 lg:px-8">
|
20 |
+
<div className="bg-white p-4 shadow sm:rounded-lg sm:p-8">
|
21 |
+
<UpdateProfileInformationForm
|
22 |
+
mustVerifyEmail={mustVerifyEmail}
|
23 |
+
status={status}
|
24 |
+
className="max-w-xl"
|
25 |
+
/>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<div className="bg-white p-4 shadow sm:rounded-lg sm:p-8">
|
29 |
+
<UpdatePasswordForm className="max-w-xl" />
|
30 |
+
</div>
|
31 |
+
|
32 |
+
<div className="bg-white p-4 shadow sm:rounded-lg sm:p-8">
|
33 |
+
<DeleteUserForm className="max-w-xl" />
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</AuthenticatedLayout>
|
38 |
+
);
|
39 |
+
}
|
laravel-sample/resources/js/Pages/Profile/Partials/DeleteUserForm.jsx
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import DangerButton from '@/Components/DangerButton';
|
2 |
+
import InputError from '@/Components/InputError';
|
3 |
+
import InputLabel from '@/Components/InputLabel';
|
4 |
+
import Modal from '@/Components/Modal';
|
5 |
+
import SecondaryButton from '@/Components/SecondaryButton';
|
6 |
+
import TextInput from '@/Components/TextInput';
|
7 |
+
import { useForm } from '@inertiajs/react';
|
8 |
+
import { useRef, useState } from 'react';
|
9 |
+
|
10 |
+
export default function DeleteUserForm({ className = '' }) {
|
11 |
+
const [confirmingUserDeletion, setConfirmingUserDeletion] = useState(false);
|
12 |
+
const passwordInput = useRef();
|
13 |
+
|
14 |
+
const {
|
15 |
+
data,
|
16 |
+
setData,
|
17 |
+
delete: destroy,
|
18 |
+
processing,
|
19 |
+
reset,
|
20 |
+
errors,
|
21 |
+
clearErrors,
|
22 |
+
} = useForm({
|
23 |
+
password: '',
|
24 |
+
});
|
25 |
+
|
26 |
+
const confirmUserDeletion = () => {
|
27 |
+
setConfirmingUserDeletion(true);
|
28 |
+
};
|
29 |
+
|
30 |
+
const deleteUser = (e) => {
|
31 |
+
e.preventDefault();
|
32 |
+
|
33 |
+
destroy(route('profile.destroy'), {
|
34 |
+
preserveScroll: true,
|
35 |
+
onSuccess: () => closeModal(),
|
36 |
+
onError: () => passwordInput.current.focus(),
|
37 |
+
onFinish: () => reset(),
|
38 |
+
});
|
39 |
+
};
|
40 |
+
|
41 |
+
const closeModal = () => {
|
42 |
+
setConfirmingUserDeletion(false);
|
43 |
+
|
44 |
+
clearErrors();
|
45 |
+
reset();
|
46 |
+
};
|
47 |
+
|
48 |
+
return (
|
49 |
+
<section className={`space-y-6 ${className}`}>
|
50 |
+
<header>
|
51 |
+
<h2 className="text-lg font-medium text-gray-900">
|
52 |
+
Delete Account
|
53 |
+
</h2>
|
54 |
+
|
55 |
+
<p className="mt-1 text-sm text-gray-600">
|
56 |
+
Once your account is deleted, all of its resources and data
|
57 |
+
will be permanently deleted. Before deleting your account,
|
58 |
+
please download any data or information that you wish to
|
59 |
+
retain.
|
60 |
+
</p>
|
61 |
+
</header>
|
62 |
+
|
63 |
+
<DangerButton onClick={confirmUserDeletion}>
|
64 |
+
Delete Account
|
65 |
+
</DangerButton>
|
66 |
+
|
67 |
+
<Modal show={confirmingUserDeletion} onClose={closeModal}>
|
68 |
+
<form onSubmit={deleteUser} className="p-6">
|
69 |
+
<h2 className="text-lg font-medium text-gray-900">
|
70 |
+
Are you sure you want to delete your account?
|
71 |
+
</h2>
|
72 |
+
|
73 |
+
<p className="mt-1 text-sm text-gray-600">
|
74 |
+
Once your account is deleted, all of its resources and
|
75 |
+
data will be permanently deleted. Please enter your
|
76 |
+
password to confirm you would like to permanently delete
|
77 |
+
your account.
|
78 |
+
</p>
|
79 |
+
|
80 |
+
<div className="mt-6">
|
81 |
+
<InputLabel
|
82 |
+
htmlFor="password"
|
83 |
+
value="Password"
|
84 |
+
className="sr-only"
|
85 |
+
/>
|
86 |
+
|
87 |
+
<TextInput
|
88 |
+
id="password"
|
89 |
+
type="password"
|
90 |
+
name="password"
|
91 |
+
ref={passwordInput}
|
92 |
+
value={data.password}
|
93 |
+
onChange={(e) =>
|
94 |
+
setData('password', e.target.value)
|
95 |
+
}
|
96 |
+
className="mt-1 block w-3/4"
|
97 |
+
isFocused
|
98 |
+
placeholder="Password"
|
99 |
+
/>
|
100 |
+
|
101 |
+
<InputError
|
102 |
+
message={errors.password}
|
103 |
+
className="mt-2"
|
104 |
+
/>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<div className="mt-6 flex justify-end">
|
108 |
+
<SecondaryButton onClick={closeModal}>
|
109 |
+
Cancel
|
110 |
+
</SecondaryButton>
|
111 |
+
|
112 |
+
<DangerButton className="ms-3" disabled={processing}>
|
113 |
+
Delete Account
|
114 |
+
</DangerButton>
|
115 |
+
</div>
|
116 |
+
</form>
|
117 |
+
</Modal>
|
118 |
+
</section>
|
119 |
+
);
|
120 |
+
}
|
laravel-sample/resources/js/Pages/Profile/Partials/UpdatePasswordForm.jsx
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import InputError from '@/Components/InputError';
|
2 |
+
import InputLabel from '@/Components/InputLabel';
|
3 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
4 |
+
import TextInput from '@/Components/TextInput';
|
5 |
+
import { Transition } from '@headlessui/react';
|
6 |
+
import { useForm } from '@inertiajs/react';
|
7 |
+
import { useRef } from 'react';
|
8 |
+
|
9 |
+
export default function UpdatePasswordForm({ className = '' }) {
|
10 |
+
const passwordInput = useRef();
|
11 |
+
const currentPasswordInput = useRef();
|
12 |
+
|
13 |
+
const {
|
14 |
+
data,
|
15 |
+
setData,
|
16 |
+
errors,
|
17 |
+
put,
|
18 |
+
reset,
|
19 |
+
processing,
|
20 |
+
recentlySuccessful,
|
21 |
+
} = useForm({
|
22 |
+
current_password: '',
|
23 |
+
password: '',
|
24 |
+
password_confirmation: '',
|
25 |
+
});
|
26 |
+
|
27 |
+
const updatePassword = (e) => {
|
28 |
+
e.preventDefault();
|
29 |
+
|
30 |
+
put(route('password.update'), {
|
31 |
+
preserveScroll: true,
|
32 |
+
onSuccess: () => reset(),
|
33 |
+
onError: (errors) => {
|
34 |
+
if (errors.password) {
|
35 |
+
reset('password', 'password_confirmation');
|
36 |
+
passwordInput.current.focus();
|
37 |
+
}
|
38 |
+
|
39 |
+
if (errors.current_password) {
|
40 |
+
reset('current_password');
|
41 |
+
currentPasswordInput.current.focus();
|
42 |
+
}
|
43 |
+
},
|
44 |
+
});
|
45 |
+
};
|
46 |
+
|
47 |
+
return (
|
48 |
+
<section className={className}>
|
49 |
+
<header>
|
50 |
+
<h2 className="text-lg font-medium text-gray-900">
|
51 |
+
Update Password
|
52 |
+
</h2>
|
53 |
+
|
54 |
+
<p className="mt-1 text-sm text-gray-600">
|
55 |
+
Ensure your account is using a long, random password to stay
|
56 |
+
secure.
|
57 |
+
</p>
|
58 |
+
</header>
|
59 |
+
|
60 |
+
<form onSubmit={updatePassword} className="mt-6 space-y-6">
|
61 |
+
<div>
|
62 |
+
<InputLabel
|
63 |
+
htmlFor="current_password"
|
64 |
+
value="Current Password"
|
65 |
+
/>
|
66 |
+
|
67 |
+
<TextInput
|
68 |
+
id="current_password"
|
69 |
+
ref={currentPasswordInput}
|
70 |
+
value={data.current_password}
|
71 |
+
onChange={(e) =>
|
72 |
+
setData('current_password', e.target.value)
|
73 |
+
}
|
74 |
+
type="password"
|
75 |
+
className="mt-1 block w-full"
|
76 |
+
autoComplete="current-password"
|
77 |
+
/>
|
78 |
+
|
79 |
+
<InputError
|
80 |
+
message={errors.current_password}
|
81 |
+
className="mt-2"
|
82 |
+
/>
|
83 |
+
</div>
|
84 |
+
|
85 |
+
<div>
|
86 |
+
<InputLabel htmlFor="password" value="New Password" />
|
87 |
+
|
88 |
+
<TextInput
|
89 |
+
id="password"
|
90 |
+
ref={passwordInput}
|
91 |
+
value={data.password}
|
92 |
+
onChange={(e) => setData('password', e.target.value)}
|
93 |
+
type="password"
|
94 |
+
className="mt-1 block w-full"
|
95 |
+
autoComplete="new-password"
|
96 |
+
/>
|
97 |
+
|
98 |
+
<InputError message={errors.password} className="mt-2" />
|
99 |
+
</div>
|
100 |
+
|
101 |
+
<div>
|
102 |
+
<InputLabel
|
103 |
+
htmlFor="password_confirmation"
|
104 |
+
value="Confirm Password"
|
105 |
+
/>
|
106 |
+
|
107 |
+
<TextInput
|
108 |
+
id="password_confirmation"
|
109 |
+
value={data.password_confirmation}
|
110 |
+
onChange={(e) =>
|
111 |
+
setData('password_confirmation', e.target.value)
|
112 |
+
}
|
113 |
+
type="password"
|
114 |
+
className="mt-1 block w-full"
|
115 |
+
autoComplete="new-password"
|
116 |
+
/>
|
117 |
+
|
118 |
+
<InputError
|
119 |
+
message={errors.password_confirmation}
|
120 |
+
className="mt-2"
|
121 |
+
/>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
<div className="flex items-center gap-4">
|
125 |
+
<PrimaryButton disabled={processing}>Save</PrimaryButton>
|
126 |
+
|
127 |
+
<Transition
|
128 |
+
show={recentlySuccessful}
|
129 |
+
enter="transition ease-in-out"
|
130 |
+
enterFrom="opacity-0"
|
131 |
+
leave="transition ease-in-out"
|
132 |
+
leaveTo="opacity-0"
|
133 |
+
>
|
134 |
+
<p className="text-sm text-gray-600">
|
135 |
+
Saved.
|
136 |
+
</p>
|
137 |
+
</Transition>
|
138 |
+
</div>
|
139 |
+
</form>
|
140 |
+
</section>
|
141 |
+
);
|
142 |
+
}
|
laravel-sample/resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.jsx
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import InputError from '@/Components/InputError';
|
2 |
+
import InputLabel from '@/Components/InputLabel';
|
3 |
+
import PrimaryButton from '@/Components/PrimaryButton';
|
4 |
+
import TextInput from '@/Components/TextInput';
|
5 |
+
import { Transition } from '@headlessui/react';
|
6 |
+
import { Link, useForm, usePage } from '@inertiajs/react';
|
7 |
+
|
8 |
+
export default function UpdateProfileInformation({
|
9 |
+
mustVerifyEmail,
|
10 |
+
status,
|
11 |
+
className = '',
|
12 |
+
}) {
|
13 |
+
const user = usePage().props.auth.user;
|
14 |
+
|
15 |
+
const { data, setData, patch, errors, processing, recentlySuccessful } =
|
16 |
+
useForm({
|
17 |
+
name: user.name,
|
18 |
+
email: user.email,
|
19 |
+
});
|
20 |
+
|
21 |
+
const submit = (e) => {
|
22 |
+
e.preventDefault();
|
23 |
+
|
24 |
+
patch(route('profile.update'));
|
25 |
+
};
|
26 |
+
|
27 |
+
return (
|
28 |
+
<section className={className}>
|
29 |
+
<header>
|
30 |
+
<h2 className="text-lg font-medium text-gray-900">
|
31 |
+
Profile Information
|
32 |
+
</h2>
|
33 |
+
|
34 |
+
<p className="mt-1 text-sm text-gray-600">
|
35 |
+
Update your account's profile information and email address.
|
36 |
+
</p>
|
37 |
+
</header>
|
38 |
+
|
39 |
+
<form onSubmit={submit} className="mt-6 space-y-6">
|
40 |
+
<div>
|
41 |
+
<InputLabel htmlFor="name" value="Name" />
|
42 |
+
|
43 |
+
<TextInput
|
44 |
+
id="name"
|
45 |
+
className="mt-1 block w-full"
|
46 |
+
value={data.name}
|
47 |
+
onChange={(e) => setData('name', e.target.value)}
|
48 |
+
required
|
49 |
+
isFocused
|
50 |
+
autoComplete="name"
|
51 |
+
/>
|
52 |
+
|
53 |
+
<InputError className="mt-2" message={errors.name} />
|
54 |
+
</div>
|
55 |
+
|
56 |
+
<div>
|
57 |
+
<InputLabel htmlFor="email" value="Email" />
|
58 |
+
|
59 |
+
<TextInput
|
60 |
+
id="email"
|
61 |
+
type="email"
|
62 |
+
className="mt-1 block w-full"
|
63 |
+
value={data.email}
|
64 |
+
onChange={(e) => setData('email', e.target.value)}
|
65 |
+
required
|
66 |
+
autoComplete="username"
|
67 |
+
/>
|
68 |
+
|
69 |
+
<InputError className="mt-2" message={errors.email} />
|
70 |
+
</div>
|
71 |
+
|
72 |
+
{mustVerifyEmail && user.email_verified_at === null && (
|
73 |
+
<div>
|
74 |
+
<p className="mt-2 text-sm text-gray-800">
|
75 |
+
Your email address is unverified.
|
76 |
+
<Link
|
77 |
+
href={route('verification.send')}
|
78 |
+
method="post"
|
79 |
+
as="button"
|
80 |
+
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
81 |
+
>
|
82 |
+
Click here to re-send the verification email.
|
83 |
+
</Link>
|
84 |
+
</p>
|
85 |
+
|
86 |
+
{status === 'verification-link-sent' && (
|
87 |
+
<div className="mt-2 text-sm font-medium text-green-600">
|
88 |
+
A new verification link has been sent to your
|
89 |
+
email address.
|
90 |
+
</div>
|
91 |
+
)}
|
92 |
+
</div>
|
93 |
+
)}
|
94 |
+
|
95 |
+
<div className="flex items-center gap-4">
|
96 |
+
<PrimaryButton disabled={processing}>Save</PrimaryButton>
|
97 |
+
|
98 |
+
<Transition
|
99 |
+
show={recentlySuccessful}
|
100 |
+
enter="transition ease-in-out"
|
101 |
+
enterFrom="opacity-0"
|
102 |
+
leave="transition ease-in-out"
|
103 |
+
leaveTo="opacity-0"
|
104 |
+
>
|
105 |
+
<p className="text-sm text-gray-600">
|
106 |
+
Saved.
|
107 |
+
</p>
|
108 |
+
</Transition>
|
109 |
+
</div>
|
110 |
+
</form>
|
111 |
+
</section>
|
112 |
+
);
|
113 |
+
}
|
laravel-sample/resources/js/Pages/Welcome.jsx
ADDED
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Head, Link } from '@inertiajs/react';
|
2 |
+
|
3 |
+
export default function Welcome({ auth, laravelVersion, phpVersion }) {
|
4 |
+
const handleImageError = () => {
|
5 |
+
document
|
6 |
+
.getElementById('screenshot-container')
|
7 |
+
?.classList.add('!hidden');
|
8 |
+
document.getElementById('docs-card')?.classList.add('!row-span-1');
|
9 |
+
document
|
10 |
+
.getElementById('docs-card-content')
|
11 |
+
?.classList.add('!flex-row');
|
12 |
+
document.getElementById('background')?.classList.add('!hidden');
|
13 |
+
};
|
14 |
+
|
15 |
+
return (
|
16 |
+
<>
|
17 |
+
<Head title="Welcome" />
|
18 |
+
<div className="bg-gray-50 text-black/50 dark:bg-black dark:text-white/50">
|
19 |
+
<img
|
20 |
+
id="background"
|
21 |
+
className="absolute -left-20 top-0 max-w-[877px]"
|
22 |
+
src="https://laravel.com/assets/img/welcome/background.svg"
|
23 |
+
/>
|
24 |
+
<div className="relative flex min-h-screen flex-col items-center justify-center selection:bg-[#FF2D20] selection:text-white">
|
25 |
+
<div className="relative w-full max-w-2xl px-6 lg:max-w-7xl">
|
26 |
+
<header className="grid grid-cols-2 items-center gap-2 py-10 lg:grid-cols-3">
|
27 |
+
<div className="flex lg:col-start-2 lg:justify-center">
|
28 |
+
<svg
|
29 |
+
className="h-12 w-auto text-white lg:h-16 lg:text-[#FF2D20]"
|
30 |
+
viewBox="0 0 62 65"
|
31 |
+
fill="none"
|
32 |
+
xmlns="http://www.w3.org/2000/svg"
|
33 |
+
>
|
34 |
+
<path
|
35 |
+
d="M61.8548 14.6253C61.8778 14.7102 61.8895 14.7978 61.8897 14.8858V28.5615C61.8898 28.737 61.8434 28.9095 61.7554 29.0614C61.6675 29.2132 61.5409 29.3392 61.3887 29.4265L49.9104 36.0351V49.1337C49.9104 49.4902 49.7209 49.8192 49.4118 49.9987L25.4519 63.7916C25.3971 63.8227 25.3372 63.8427 25.2774 63.8639C25.255 63.8714 25.2338 63.8851 25.2101 63.8913C25.0426 63.9354 24.8666 63.9354 24.6991 63.8913C24.6716 63.8838 24.6467 63.8689 24.6205 63.8589C24.5657 63.8389 24.5084 63.8215 24.456 63.7916L0.501061 49.9987C0.348882 49.9113 0.222437 49.7853 0.134469 49.6334C0.0465019 49.4816 0.000120578 49.3092 0 49.1337L0 8.10652C0 8.01678 0.0124642 7.92953 0.0348998 7.84477C0.0423783 7.8161 0.0598282 7.78993 0.0697995 7.76126C0.0884958 7.70891 0.105946 7.65531 0.133367 7.6067C0.152063 7.5743 0.179485 7.54812 0.20192 7.51821C0.230588 7.47832 0.256763 7.43719 0.290416 7.40229C0.319084 7.37362 0.356476 7.35243 0.388883 7.32751C0.425029 7.29759 0.457436 7.26518 0.498568 7.2415L12.4779 0.345059C12.6296 0.257786 12.8015 0.211853 12.9765 0.211853C13.1515 0.211853 13.3234 0.257786 13.475 0.345059L25.4531 7.2415H25.4556C25.4955 7.26643 25.5292 7.29759 25.5653 7.32626C25.5977 7.35119 25.6339 7.37362 25.6625 7.40104C25.6974 7.43719 25.7224 7.47832 25.7523 7.51821C25.7735 7.54812 25.8021 7.5743 25.8196 7.6067C25.8483 7.65656 25.8645 7.70891 25.8844 7.76126C25.8944 7.78993 25.9118 7.8161 25.9193 7.84602C25.9423 7.93096 25.954 8.01853 25.9542 8.10652V33.7317L35.9355 27.9844V14.8846C35.9355 14.7973 35.948 14.7088 35.9704 14.6253C35.9792 14.5954 35.9954 14.5692 36.0053 14.5405C36.0253 14.4882 36.0427 14.4346 36.0702 14.386C36.0888 14.3536 36.1163 14.3274 36.1375 14.2975C36.1674 14.2576 36.1923 14.2165 36.2272 14.1816C36.2559 14.1529 36.292 14.1317 36.3244 14.1068C36.3618 14.0769 36.3942 14.0445 36.4341 14.0208L48.4147 7.12434C48.5663 7.03694 48.7383 6.99094 48.9133 6.99094C49.0883 6.99094 49.2602 7.03694 49.4118 7.12434L61.3899 14.0208C61.4323 14.0457 61.4647 14.0769 61.5021 14.1055C61.5333 14.1305 61.5694 14.1529 61.5981 14.1803C61.633 14.2165 61.6579 14.2576 61.6878 14.2975C61.7103 14.3274 61.7377 14.3536 61.7551 14.386C61.7838 14.4346 61.8 14.4882 61.8199 14.5405C61.8312 14.5692 61.8474 14.5954 61.8548 14.6253ZM59.893 27.9844V16.6121L55.7013 19.0252L49.9104 22.3593V33.7317L59.8942 27.9844H59.893ZM47.9149 48.5566V37.1768L42.2187 40.4299L25.953 49.7133V61.2003L47.9149 48.5566ZM1.99677 9.83281V48.5566L23.9562 61.199V49.7145L12.4841 43.2219L12.4804 43.2194L12.4754 43.2169C12.4368 43.1945 12.4044 43.1621 12.3682 43.1347C12.3371 43.1097 12.3009 43.0898 12.2735 43.0624L12.271 43.0586C12.2386 43.0275 12.2162 42.9888 12.1887 42.9539C12.1638 42.9203 12.1339 42.8916 12.114 42.8567L12.1127 42.853C12.0903 42.8156 12.0766 42.7707 12.0604 42.7283C12.0442 42.6909 12.023 42.656 12.013 42.6161C12.0005 42.5688 11.998 42.5177 11.9931 42.4691C11.9881 42.4317 11.9781 42.3943 11.9781 42.3569V15.5801L6.18848 12.2446L1.99677 9.83281ZM12.9777 2.36177L2.99764 8.10652L12.9752 13.8513L22.9541 8.10527L12.9752 2.36177H12.9777ZM18.1678 38.2138L23.9574 34.8809V9.83281L19.7657 12.2459L13.9749 15.5801V40.6281L18.1678 38.2138ZM48.9133 9.14105L38.9344 14.8858L48.9133 20.6305L58.8909 14.8846L48.9133 9.14105ZM47.9149 22.3593L42.124 19.0252L37.9323 16.6121V27.9844L43.7219 31.3174L47.9149 33.7317V22.3593ZM24.9533 47.987L39.59 39.631L46.9065 35.4555L36.9352 29.7145L25.4544 36.3242L14.9907 42.3482L24.9533 47.987Z"
|
36 |
+
fill="currentColor"
|
37 |
+
/>
|
38 |
+
</svg>
|
39 |
+
</div>
|
40 |
+
<nav className="-mx-3 flex flex-1 justify-end">
|
41 |
+
{auth.user ? (
|
42 |
+
<Link
|
43 |
+
href={route('dashboard')}
|
44 |
+
className="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white"
|
45 |
+
>
|
46 |
+
Dashboard
|
47 |
+
</Link>
|
48 |
+
) : (
|
49 |
+
<>
|
50 |
+
<Link
|
51 |
+
href={route('login')}
|
52 |
+
className="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white"
|
53 |
+
>
|
54 |
+
Log in
|
55 |
+
</Link>
|
56 |
+
<Link
|
57 |
+
href={route('register')}
|
58 |
+
className="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white"
|
59 |
+
>
|
60 |
+
Register
|
61 |
+
</Link>
|
62 |
+
</>
|
63 |
+
)}
|
64 |
+
</nav>
|
65 |
+
</header>
|
66 |
+
|
67 |
+
<main className="mt-6">
|
68 |
+
<div className="grid gap-6 lg:grid-cols-2 lg:gap-8">
|
69 |
+
<a
|
70 |
+
href="https://laravel.com/docs"
|
71 |
+
id="docs-card"
|
72 |
+
className="flex flex-col items-start gap-6 overflow-hidden rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] md:row-span-3 lg:p-10 lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]"
|
73 |
+
>
|
74 |
+
<div
|
75 |
+
id="screenshot-container"
|
76 |
+
className="relative flex w-full flex-1 items-stretch"
|
77 |
+
>
|
78 |
+
<img
|
79 |
+
src="https://laravel.com/assets/img/welcome/docs-light.svg"
|
80 |
+
alt="Laravel documentation screenshot"
|
81 |
+
className="aspect-video h-full w-full flex-1 rounded-[10px] object-cover object-top drop-shadow-[0px_4px_34px_rgba(0,0,0,0.06)] dark:hidden"
|
82 |
+
onError={handleImageError}
|
83 |
+
/>
|
84 |
+
<img
|
85 |
+
src="https://laravel.com/assets/img/welcome/docs-dark.svg"
|
86 |
+
alt="Laravel documentation screenshot"
|
87 |
+
className="hidden aspect-video h-full w-full flex-1 rounded-[10px] object-cover object-top drop-shadow-[0px_4px_34px_rgba(0,0,0,0.25)] dark:block"
|
88 |
+
/>
|
89 |
+
<div className="absolute -bottom-16 -left-16 h-40 w-[calc(100%+8rem)] bg-gradient-to-b from-transparent via-white to-white dark:via-zinc-900 dark:to-zinc-900"></div>
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<div className="relative flex items-center gap-6 lg:items-end">
|
93 |
+
<div
|
94 |
+
id="docs-card-content"
|
95 |
+
className="flex items-start gap-6 lg:flex-col"
|
96 |
+
>
|
97 |
+
<div className="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
98 |
+
<svg
|
99 |
+
className="size-5 sm:size-6"
|
100 |
+
xmlns="http://www.w3.org/2000/svg"
|
101 |
+
fill="none"
|
102 |
+
viewBox="0 0 24 24"
|
103 |
+
>
|
104 |
+
<path
|
105 |
+
fill="#FF2D20"
|
106 |
+
d="M23 4a1 1 0 0 0-1.447-.894L12.224 7.77a.5.5 0 0 1-.448 0L2.447 3.106A1 1 0 0 0 1 4v13.382a1.99 1.99 0 0 0 1.105 1.79l9.448 4.728c.14.065.293.1.447.1.154-.005.306-.04.447-.105l9.453-4.724a1.99 1.99 0 0 0 1.1-1.789V4ZM3 6.023a.25.25 0 0 1 .362-.223l7.5 3.75a.251.251 0 0 1 .138.223v11.2a.25.25 0 0 1-.362.224l-7.5-3.75a.25.25 0 0 1-.138-.22V6.023Zm18 11.2a.25.25 0 0 1-.138.224l-7.5 3.75a.249.249 0 0 1-.329-.099.249.249 0 0 1-.033-.12V9.772a.251.251 0 0 1 .138-.224l7.5-3.75a.25.25 0 0 1 .362.224v11.2Z"
|
107 |
+
/>
|
108 |
+
<path
|
109 |
+
fill="#FF2D20"
|
110 |
+
d="m3.55 1.893 8 4.048a1.008 1.008 0 0 0 .9 0l8-4.048a1 1 0 0 0-.9-1.785l-7.322 3.706a.506.506 0 0 1-.452 0L4.454.108a1 1 0 0 0-.9 1.785H3.55Z"
|
111 |
+
/>
|
112 |
+
</svg>
|
113 |
+
</div>
|
114 |
+
|
115 |
+
<div className="pt-3 sm:pt-5 lg:pt-0">
|
116 |
+
<h2 className="text-xl font-semibold text-black dark:text-white">
|
117 |
+
Documentation
|
118 |
+
</h2>
|
119 |
+
|
120 |
+
<p className="mt-4 text-sm/relaxed">
|
121 |
+
Laravel has wonderful
|
122 |
+
documentation covering every
|
123 |
+
aspect of the framework.
|
124 |
+
Whether you are a newcomer
|
125 |
+
or have prior experience
|
126 |
+
with Laravel, we recommend
|
127 |
+
reading our documentation
|
128 |
+
from beginning to end.
|
129 |
+
</p>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<svg
|
134 |
+
className="size-6 shrink-0 stroke-[#FF2D20]"
|
135 |
+
xmlns="http://www.w3.org/2000/svg"
|
136 |
+
fill="none"
|
137 |
+
viewBox="0 0 24 24"
|
138 |
+
strokeWidth="1.5"
|
139 |
+
>
|
140 |
+
<path
|
141 |
+
strokeLinecap="round"
|
142 |
+
strokeLinejoin="round"
|
143 |
+
d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"
|
144 |
+
/>
|
145 |
+
</svg>
|
146 |
+
</div>
|
147 |
+
</a>
|
148 |
+
|
149 |
+
<a
|
150 |
+
href="https://laracasts.com"
|
151 |
+
className="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]"
|
152 |
+
>
|
153 |
+
<div className="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
154 |
+
<svg
|
155 |
+
className="size-5 sm:size-6"
|
156 |
+
xmlns="http://www.w3.org/2000/svg"
|
157 |
+
fill="none"
|
158 |
+
viewBox="0 0 24 24"
|
159 |
+
>
|
160 |
+
<g fill="#FF2D20">
|
161 |
+
<path d="M24 8.25a.5.5 0 0 0-.5-.5H.5a.5.5 0 0 0-.5.5v12a2.5 2.5 0 0 0 2.5 2.5h19a2.5 2.5 0 0 0 2.5-2.5v-12Zm-7.765 5.868a1.221 1.221 0 0 1 0 2.264l-6.626 2.776A1.153 1.153 0 0 1 8 18.123v-5.746a1.151 1.151 0 0 1 1.609-1.035l6.626 2.776ZM19.564 1.677a.25.25 0 0 0-.177-.427H15.6a.106.106 0 0 0-.072.03l-4.54 4.543a.25.25 0 0 0 .177.427h3.783c.027 0 .054-.01.073-.03l4.543-4.543ZM22.071 1.318a.047.047 0 0 0-.045.013l-4.492 4.492a.249.249 0 0 0 .038.385.25.25 0 0 0 .14.042h5.784a.5.5 0 0 0 .5-.5v-2a2.5 2.5 0 0 0-1.925-2.432ZM13.014 1.677a.25.25 0 0 0-.178-.427H9.101a.106.106 0 0 0-.073.03l-4.54 4.543a.25.25 0 0 0 .177.427H8.4a.106.106 0 0 0 .073-.03l4.54-4.543ZM6.513 1.677a.25.25 0 0 0-.177-.427H2.5A2.5 2.5 0 0 0 0 3.75v2a.5.5 0 0 0 .5.5h1.4a.106.106 0 0 0 .073-.03l4.54-4.543Z" />
|
162 |
+
</g>
|
163 |
+
</svg>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
<div className="pt-3 sm:pt-5">
|
167 |
+
<h2 className="text-xl font-semibold text-black dark:text-white">
|
168 |
+
Laracasts
|
169 |
+
</h2>
|
170 |
+
|
171 |
+
<p className="mt-4 text-sm/relaxed">
|
172 |
+
Laracasts offers thousands of video
|
173 |
+
tutorials on Laravel, PHP, and
|
174 |
+
JavaScript development. Check them
|
175 |
+
out, see for yourself, and massively
|
176 |
+
level up your development skills in
|
177 |
+
the process.
|
178 |
+
</p>
|
179 |
+
</div>
|
180 |
+
|
181 |
+
<svg
|
182 |
+
className="size-6 shrink-0 self-center stroke-[#FF2D20]"
|
183 |
+
xmlns="http://www.w3.org/2000/svg"
|
184 |
+
fill="none"
|
185 |
+
viewBox="0 0 24 24"
|
186 |
+
strokeWidth="1.5"
|
187 |
+
>
|
188 |
+
<path
|
189 |
+
strokeLinecap="round"
|
190 |
+
strokeLinejoin="round"
|
191 |
+
d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"
|
192 |
+
/>
|
193 |
+
</svg>
|
194 |
+
</a>
|
195 |
+
|
196 |
+
<a
|
197 |
+
href="https://laravel-news.com"
|
198 |
+
className="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]"
|
199 |
+
>
|
200 |
+
<div className="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
201 |
+
<svg
|
202 |
+
className="size-5 sm:size-6"
|
203 |
+
xmlns="http://www.w3.org/2000/svg"
|
204 |
+
fill="none"
|
205 |
+
viewBox="0 0 24 24"
|
206 |
+
>
|
207 |
+
<g fill="#FF2D20">
|
208 |
+
<path d="M8.75 4.5H5.5c-.69 0-1.25.56-1.25 1.25v4.75c0 .69.56 1.25 1.25 1.25h3.25c.69 0 1.25-.56 1.25-1.25V5.75c0-.69-.56-1.25-1.25-1.25Z" />
|
209 |
+
<path d="M24 10a3 3 0 0 0-3-3h-2V2.5a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2V20a3.5 3.5 0 0 0 3.5 3.5h17A3.5 3.5 0 0 0 24 20V10ZM3.5 21.5A1.5 1.5 0 0 1 2 20V3a.5.5 0 0 1 .5-.5h14a.5.5 0 0 1 .5.5v17c0 .295.037.588.11.874a.5.5 0 0 1-.484.625L3.5 21.5ZM22 20a1.5 1.5 0 1 1-3 0V9.5a.5.5 0 0 1 .5-.5H21a1 1 0 0 1 1 1v10Z" />
|
210 |
+
<path d="M12.751 6.047h2a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 12 7.3v-.5a.75.75 0 0 1 .751-.753ZM12.751 10.047h2a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 12 11.3v-.5a.75.75 0 0 1 .751-.753ZM4.751 14.047h10a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-10A.75.75 0 0 1 4 15.3v-.5a.75.75 0 0 1 .751-.753ZM4.75 18.047h7.5a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-7.5A.75.75 0 0 1 4 19.3v-.5a.75.75 0 0 1 .75-.753Z" />
|
211 |
+
</g>
|
212 |
+
</svg>
|
213 |
+
</div>
|
214 |
+
|
215 |
+
<div className="pt-3 sm:pt-5">
|
216 |
+
<h2 className="text-xl font-semibold text-black dark:text-white">
|
217 |
+
Laravel News
|
218 |
+
</h2>
|
219 |
+
|
220 |
+
<p className="mt-4 text-sm/relaxed">
|
221 |
+
Laravel News is a community driven
|
222 |
+
portal and newsletter aggregating
|
223 |
+
all of the latest and most important
|
224 |
+
news in the Laravel ecosystem,
|
225 |
+
including new package releases and
|
226 |
+
tutorials.
|
227 |
+
</p>
|
228 |
+
</div>
|
229 |
+
|
230 |
+
<svg
|
231 |
+
className="size-6 shrink-0 self-center stroke-[#FF2D20]"
|
232 |
+
xmlns="http://www.w3.org/2000/svg"
|
233 |
+
fill="none"
|
234 |
+
viewBox="0 0 24 24"
|
235 |
+
strokeWidth="1.5"
|
236 |
+
>
|
237 |
+
<path
|
238 |
+
strokeLinecap="round"
|
239 |
+
strokeLinejoin="round"
|
240 |
+
d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"
|
241 |
+
/>
|
242 |
+
</svg>
|
243 |
+
</a>
|
244 |
+
|
245 |
+
<div className="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800">
|
246 |
+
<div className="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
247 |
+
<svg
|
248 |
+
className="size-5 sm:size-6"
|
249 |
+
xmlns="http://www.w3.org/2000/svg"
|
250 |
+
fill="none"
|
251 |
+
viewBox="0 0 24 24"
|
252 |
+
>
|
253 |
+
<g fill="#FF2D20">
|
254 |
+
<path d="M16.597 12.635a.247.247 0 0 0-.08-.237 2.234 2.234 0 0 1-.769-1.68c.001-.195.03-.39.084-.578a.25.25 0 0 0-.09-.267 8.8 8.8 0 0 0-4.826-1.66.25.25 0 0 0-.268.181 2.5 2.5 0 0 1-2.4 1.824.045.045 0 0 0-.045.037 12.255 12.255 0 0 0-.093 3.86.251.251 0 0 0 .208.214c2.22.366 4.367 1.08 6.362 2.118a.252.252 0 0 0 .32-.079 10.09 10.09 0 0 0 1.597-3.733ZM13.616 17.968a.25.25 0 0 0-.063-.407A19.697 19.697 0 0 0 8.91 15.98a.25.25 0 0 0-.287.325c.151.455.334.898.548 1.328.437.827.981 1.594 1.619 2.28a.249.249 0 0 0 .32.044 29.13 29.13 0 0 0 2.506-1.99ZM6.303 14.105a.25.25 0 0 0 .265-.274 13.048 13.048 0 0 1 .205-4.045.062.062 0 0 0-.022-.07 2.5 2.5 0 0 1-.777-.982.25.25 0 0 0-.271-.149 11 11 0 0 0-5.6 2.815.255.255 0 0 0-.075.163c-.008.135-.02.27-.02.406.002.8.084 1.598.246 2.381a.25.25 0 0 0 .303.193 19.924 19.924 0 0 1 5.746-.438ZM9.228 20.914a.25.25 0 0 0 .1-.393 11.53 11.53 0 0 1-1.5-2.22 12.238 12.238 0 0 1-.91-2.465.248.248 0 0 0-.22-.187 18.876 18.876 0 0 0-5.69.33.249.249 0 0 0-.179.336c.838 2.142 2.272 4 4.132 5.353a.254.254 0 0 0 .15.048c1.41-.01 2.807-.282 4.117-.802ZM18.93 12.957l-.005-.008a.25.25 0 0 0-.268-.082 2.21 2.21 0 0 1-.41.081.25.25 0 0 0-.217.2c-.582 2.66-2.127 5.35-5.75 7.843a.248.248 0 0 0-.09.299.25.25 0 0 0 .065.091 28.703 28.703 0 0 0 2.662 2.12.246.246 0 0 0 .209.037c2.579-.701 4.85-2.242 6.456-4.378a.25.25 0 0 0 .048-.189 13.51 13.51 0 0 0-2.7-6.014ZM5.702 7.058a.254.254 0 0 0 .2-.165A2.488 2.488 0 0 1 7.98 5.245a.093.093 0 0 0 .078-.062 19.734 19.734 0 0 1 3.055-4.74.25.25 0 0 0-.21-.41 12.009 12.009 0 0 0-10.4 8.558.25.25 0 0 0 .373.281 12.912 12.912 0 0 1 4.826-1.814ZM10.773 22.052a.25.25 0 0 0-.28-.046c-.758.356-1.55.635-2.365.833a.25.25 0 0 0-.022.48c1.252.43 2.568.65 3.893.65.1 0 .2 0 .3-.008a.25.25 0 0 0 .147-.444c-.526-.424-1.1-.917-1.673-1.465ZM18.744 8.436a.249.249 0 0 0 .15.228 2.246 2.246 0 0 1 1.352 2.054c0 .337-.08.67-.23.972a.25.25 0 0 0 .042.28l.007.009a15.016 15.016 0 0 1 2.52 4.6.25.25 0 0 0 .37.132.25.25 0 0 0 .096-.114c.623-1.464.944-3.039.945-4.63a12.005 12.005 0 0 0-5.78-10.258.25.25 0 0 0-.373.274c.547 2.109.85 4.274.901 6.453ZM9.61 5.38a.25.25 0 0 0 .08.31c.34.24.616.561.8.935a.25.25 0 0 0 .3.127.631.631 0 0 1 .206-.034c2.054.078 4.036.772 5.69 1.991a.251.251 0 0 0 .267.024c.046-.024.093-.047.141-.067a.25.25 0 0 0 .151-.23A29.98 29.98 0 0 0 15.957.764a.25.25 0 0 0-.16-.164 11.924 11.924 0 0 0-2.21-.518.252.252 0 0 0-.215.076A22.456 22.456 0 0 0 9.61 5.38Z" />
|
255 |
+
</g>
|
256 |
+
</svg>
|
257 |
+
</div>
|
258 |
+
|
259 |
+
<div className="pt-3 sm:pt-5">
|
260 |
+
<h2 className="text-xl font-semibold text-black dark:text-white">
|
261 |
+
Vibrant Ecosystem
|
262 |
+
</h2>
|
263 |
+
|
264 |
+
<p className="mt-4 text-sm/relaxed">
|
265 |
+
Laravel's robust library of
|
266 |
+
first-party tools and libraries,
|
267 |
+
such as{' '}
|
268 |
+
<a
|
269 |
+
href="https://forge.laravel.com"
|
270 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white dark:focus-visible:ring-[#FF2D20]"
|
271 |
+
>
|
272 |
+
Forge
|
273 |
+
</a>
|
274 |
+
,{' '}
|
275 |
+
<a
|
276 |
+
href="https://vapor.laravel.com"
|
277 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
278 |
+
>
|
279 |
+
Vapor
|
280 |
+
</a>
|
281 |
+
,{' '}
|
282 |
+
<a
|
283 |
+
href="https://nova.laravel.com"
|
284 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
285 |
+
>
|
286 |
+
Nova
|
287 |
+
</a>
|
288 |
+
,{' '}
|
289 |
+
<a
|
290 |
+
href="https://envoyer.io"
|
291 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
292 |
+
>
|
293 |
+
Envoyer
|
294 |
+
</a>
|
295 |
+
, and{' '}
|
296 |
+
<a
|
297 |
+
href="https://herd.laravel.com"
|
298 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
299 |
+
>
|
300 |
+
Herd
|
301 |
+
</a>{' '}
|
302 |
+
help you take your projects to the
|
303 |
+
next level. Pair them with powerful
|
304 |
+
open source libraries like{' '}
|
305 |
+
<a
|
306 |
+
href="https://laravel.com/docs/billing"
|
307 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
308 |
+
>
|
309 |
+
Cashier
|
310 |
+
</a>
|
311 |
+
,{' '}
|
312 |
+
<a
|
313 |
+
href="https://laravel.com/docs/dusk"
|
314 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
315 |
+
>
|
316 |
+
Dusk
|
317 |
+
</a>
|
318 |
+
,{' '}
|
319 |
+
<a
|
320 |
+
href="https://laravel.com/docs/broadcasting"
|
321 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
322 |
+
>
|
323 |
+
Echo
|
324 |
+
</a>
|
325 |
+
,{' '}
|
326 |
+
<a
|
327 |
+
href="https://laravel.com/docs/horizon"
|
328 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
329 |
+
>
|
330 |
+
Horizon
|
331 |
+
</a>
|
332 |
+
,{' '}
|
333 |
+
<a
|
334 |
+
href="https://laravel.com/docs/sanctum"
|
335 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
336 |
+
>
|
337 |
+
Sanctum
|
338 |
+
</a>
|
339 |
+
,{' '}
|
340 |
+
<a
|
341 |
+
href="https://laravel.com/docs/telescope"
|
342 |
+
className="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white"
|
343 |
+
>
|
344 |
+
Telescope
|
345 |
+
</a>
|
346 |
+
, and more.
|
347 |
+
</p>
|
348 |
+
</div>
|
349 |
+
</div>
|
350 |
+
</div>
|
351 |
+
</main>
|
352 |
+
|
353 |
+
<footer className="py-16 text-center text-sm text-black dark:text-white/70">
|
354 |
+
Laravel v{laravelVersion} (PHP v{phpVersion})
|
355 |
+
</footer>
|
356 |
+
</div>
|
357 |
+
</div>
|
358 |
+
</div>
|
359 |
+
</>
|
360 |
+
);
|
361 |
+
}
|