Frontend Livewire Components
This page documents the Livewire components used on the frontend of LaraCMS, including user profiles, galleries, and user interface elements.Profile
Namespace:App\Livewire\Frontend\Profile
Location: app/Livewire/Frontend/Profile.php:9
Displays the authenticated user’s profile with tabbed navigation.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
$user | User | null | The authenticated user model |
$activeTab | string | 'profile' | Currently active tab |
Public Methods
mount()
Initializes the component with the authenticated user.- Loads the authenticated user
- Sets the user property
setTab($tab)
Switches to a different tab.$tab(string) - The tab identifier to activate
'profile', 'settings', 'activity', etc.
Usage in Blade
UserMenu
Namespace:App\Livewire\UserMenu
Location: app/Livewire/UserMenu.php:7
Displays the user dropdown menu in the navigation bar.
Usage in Blade
Gallery Components
LaraCMS includes three gallery components for displaying photo albums and images.Gallery Index
Namespace:App\Livewire\Gallery\Index
Location: app/Livewire/Gallery/Index.php:8
Displays a paginated grid of photo albums.
Render Method
Loads and paginates albums:- Displays 20 albums per page (5x4 grid)
- Ordered by most recent first
Usage in Blade
Gallery Album
Namespace:App\Livewire\Gallery\Album
Location: app/Livewire/Gallery/Album.php:8
Displays images within a specific album.
Properties
| Property | Type | Description |
|---|---|---|
$album | Album | The album model being displayed |
Public Methods
mount(Album $album)
Initializes the component with an album.$album(Album) - The album to display
Render Method
Loads images from the album:images() relationship:
Usage in Blade
Gallery Image
Namespace:App\Livewire\Gallery\Image
Location: app/Livewire/Gallery/Image.php:9
Displays a single image with album context.
Properties
| Property | Type | Description |
|---|---|---|
$album | Album | The parent album |
$image | Image | The image being displayed |
Public Methods
mount(Album image)
Initializes the component with album and image.$album(Album) - The parent album$image(Image) - The specific image to display
Usage in Blade
Settings Components
User settings components for managing profile and account preferences.Settings Profile
Namespace:App\Livewire\Settings\Profile
Location: app/Livewire/Settings/Profile.php:11
Manages user profile information updates.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
$name | string | '' | User’s name |
$email | string | '' | User’s email address |
Public Methods
mount()
Initializes the form with current user data.- Loads authenticated user’s name and email
updateProfileInformation()
Updates the user’s profile information.- Validates name and email
- Updates user record
- Resets email verification if email changed
- Dispatches ‘profile-updated’ event
resendVerificationNotification()
Resends email verification notification.- Checks if email is already verified
- Sends verification notification
- Flashes ‘verification-link-sent’ status
Usage in Blade
Settings Password
Namespace:App\Livewire\Settings\Password
Location: app/Livewire/Settings/Password.php:11
Allows users to update their password.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
$current_password | string | '' | Current password |
$password | string | '' | New password |
$password_confirmation | string | '' | Password confirmation |
Public Methods
updatePassword()
Updates the user’s password.- Validates current password
- Validates new password meets requirements
- Updates password with hash
- Logs out other devices
- Resets form fields
- Dispatches ‘password-updated’ event
- Clears form fields on validation error
- Invalidates sessions on other devices
Usage in Blade
Delete User Form
Namespace:App\Livewire\Settings\DeleteUserForm
Location: app/Livewire/Settings/DeleteUserForm.php:9
Allows users to permanently delete their account.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
$password | string | '' | Password confirmation |
Public Methods
deleteUser(Logout $logout)
Deletes the authenticated user’s account.$logout(Logout) - Logout action dependency injection
- Password must be required, string, and match current password
- Validates password
- Logs out the user
- Deletes user account
- Redirects to home page
- Requires password confirmation
- Cannot be undone