Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AlexanderDamont1/Stratus/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Controllers live in app/Http/Controllers/. All controllers extend the base Controller class at app/Http/Controllers/Controller.php, which in turn extends Laravel’s Illuminate\Routing\Controller. Authentication controllers are grouped in app/Http/Controllers/Auth/ and are generated and maintained by Laravel Breeze.

Base controller

File: app/Http/Controllers/Controller.php The base class that all other controllers extend. Add shared middleware, helpers, or response methods here when they need to be available across the application.

ProfileController

File: app/Http/Controllers/ProfileController.php Handles authenticated user profile management.

Methods

edit(Request $request): View

Displays the profile editing form.
public function edit(Request $request): View
{
    return view('profile.edit', ['user' => $request->user()]);
}
Route: GET /profile — protected by auth middleware.

update(ProfileUpdateRequest $request): RedirectResponse

Persists profile changes. If the email address is changed, email_verified_at is reset to null, requiring the user to re-verify.
public function update(ProfileUpdateRequest $request): RedirectResponse
{
    $request->user()->fill($request->validated());

    if ($request->user()->isDirty('email')) {
        $request->user()->email_verified_at = null;
    }

    $request->user()->save();

    return Redirect::route('profile.edit')->with('status', 'profile-updated');
}
Route: PATCH /profile — protected by auth middleware.
Validation rules for profile updates are defined in app/Http/Requests/ProfileUpdateRequest.php. The rules are:
  • name — required, string, max 255 characters
  • email — required, string, lowercase, valid email format, max 255 characters, unique in the users table (excluding the current user’s own record)

destroy(Request $request): RedirectResponse

Permanently deletes the authenticated user’s account. Requires the current password for confirmation.
public function destroy(Request $request): RedirectResponse
{
    $request->validateWithBag('userDeletion', [
        'password' => ['required', 'current_password'],
    ]);

    $user = $request->user();
    Auth::logout();
    $user->delete();
    $request->session()->invalidate();
    $request->session()->regenerateToken();

    return Redirect::to('/');
}
Route: DELETE /profile — protected by auth middleware.
This action is irreversible. The user record and all associated data are permanently deleted.

Auth controllers

All auth controllers live in app/Http/Controllers/Auth/. They handle the full authentication lifecycle for Stratus.

AuthenticatedSessionController

Handles login and logout.
MethodHTTPRouteDescription
createGET/loginShow the login form
storePOST/loginAuthenticate the user and start a session
destroyPOST/logoutLog the user out and invalidate the session
Login requests are validated via App\Http\Requests\Auth\LoginRequest, which enforces:
  • Required email and password fields
  • Rate limiting: 5 failed attempts per email+IP combination triggers a lockout
  • Optional remember boolean for persistent sessions

RegisteredUserController

Handles new user registration.
MethodHTTPRouteDescription
createGET/registerShow the registration form
storePOST/registerValidate, create the user, and log them in

PasswordResetLinkController

Sends a password reset email.
MethodHTTPRouteDescription
createGET/forgot-passwordShow the forgot password form
storePOST/forgot-passwordSend the password reset link email

NewPasswordController

Handles resetting a password using a valid reset token.
MethodHTTPRouteDescription
createGET/reset-password/{token}Show the new password form
storePOST/reset-passwordValidate the token and update the password

PasswordController

Updates the password for an already-authenticated user.
MethodHTTPRouteDescription
updatePUT/passwordValidate current password and set a new one
Password update validation uses the updatePassword error bag. This allows the profile page to display password errors separately from profile information errors.

VerifyEmailController

Handles the email verification link clicked from the verification email.
MethodHTTPRouteDescription
__invokeGET/verify-email/{id}/{hash}Mark the email as verified and redirect
The route requires both the signed middleware (URL signature validation) and is throttled at 6 requests per minute.

EmailVerificationNotificationController

Resends the email verification notification.
MethodHTTPRouteDescription
storePOST/email/verification-notificationResend the verification email (rate-limited: 6/min)

EmailVerificationPromptController

Shows the email verification prompt to users who have not yet verified.
MethodHTTPRouteDescription
__invokeGET/verify-emailShow the verification prompt page

ConfirmablePasswordController

Used to re-confirm a password before performing sensitive actions (e.g., enabling two-factor auth).
MethodHTTPRouteDescription
showGET/confirm-passwordShow the password confirmation form
storePOST/confirm-passwordValidate the password and mark the session as confirmed

Adding new controllers

1

Generate a controller

php artisan make:controller ProductController
For a resource controller with all CRUD methods:
php artisan make:controller ProductController --resource
2

Extend the base controller

The generated file will automatically extend Controller:
app/Http/Controllers/ProductController.php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProductController extends Controller
{
    public function index()
    {
        //
    }
}
3

Add routes

Register the controller in routes/web.php:
routes/web.php
use App\Http\Controllers\ProductController;

Route::resource('products', ProductController::class)
    ->middleware(['auth', 'verified']);
4

Create a form request (optional)

For controllers with validation, generate a form request to keep the controller thin:
php artisan make:request StoreProductRequest

Build docs developers (and LLMs) love