Download the PHP package joaopaulolndev/filament-edit-profile without Composer

On this page you can find all versions of the php package joaopaulolndev/filament-edit-profile. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-edit-profile

Filament package to edit profile

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The Filament library is a user-friendly tool that simplifies profile editing, offering an intuitive interface and robust features to easily customize and manage user information.

![Screenshot of Application Feature](https://raw.githubusercontent.com/joaopaulolndev/filament-edit-profile/2.x/art/joaopaulolndev-filament-edit-profile.jpg)

Features & Screenshots

Compatibility

Package Version Filament Version
1.x 3.x
2.x 4.x

Installation

You can install the package via composer:

Filament V3 - if you are using Filament v3.x, you can use this section

You can publish and run the migrations with:

Optionally, you can publish the views using

Optionally, you can publish the translations using

You can publish and run all the migrations with:

You can publish the config file with:

Usage

Add in AdminPanelProvider.php

if you want to show for specific parameters to sort, icon, title, navigation group, navigation label and can access, you can use the following example:

Optionally, you can add a user menu item to the user menu in the navigation bar:

If needed you can define the disk and visibility of the avatar image. In the config file add the following:

config/filament-edit-profile.php

Profile Avatar

Screenshot of avatar Feature Show the user avatar form using shouldShowAvatarForm(). This package follows the Filament user avatar to manage the avatar.

To show the avatar form, you need the following steps:

  1. Publish the migration file to add the avatar_url field to the users table:

  2. Add in your User model the avatar_url field in the fillable array:

  3. Set the getFilamentAvatarUrlAttribute method in your User model:

  4. Optionally, you can specify the image directory path and file upload rules. :

  5. Don't forget to run the command php artisan storage:link

Profile Locale

Show the user locale form using shouldShowLocaleForm(). You can now customize validation rules for this field using the rules parameter (e.g., 'required'). If you don't set rules, the field is not required by default.

To show the locale form, you need the following steps:

  1. Publish the migration file to add the locale field to the users table:

  2. Update the options array with the languages you want to show:

  3. Add in your User model the locale field in the fillable array:

Profile Theme Color

Show the user theme_color form using shouldShowThemeColorForm(). You can now customize validation rules for this field using the rules parameter (e.g., 'required'). If you don't set rules, the field is not required by default.

To show the theme_color form, you need the following steps:

  1. Publish the migration file to add the theme_color field to the users table:

  2. Update the primary color default value:

  3. Add in your User model the locale field in the fillable array:

Email Change Verification

The filament-edit-profile plugin is fully compatible with the emailChangeVerification feature introduced in Filament.

When this feature is enabled in your Panel Provider, the plugin ensures that an email address change is only finalized after the user confirms ownership of the new email address.

How It Works

  1. A user navigates to the edit profile page provided by this plugin.
  2. They change their email address and click "Save".
  3. The plugin, using Filament's core logic, does not update the email in the database immediately.
  4. Instead, a verification email with a signed link is sent to the new email address.
  5. The user's email in the database is only updated after they click the confirmation link sent to the new address.

This prevents users from being locked out of their accounts if they enter an incorrect email address, and it stops malicious attempts to take over an account by changing the owner's email without permission.

How to Enable

You don't need to change any code within the filament-edit-profile plugin to enable this feature. Simply follow the official Filament documentation steps:

  1. Enable verification in your Panel Provider:

    In your Panel Provider file (e.g., app/Providers/Filament/AdminPanelProvider.php), add the emailChangeVerification() method to the panel configuration:

That's it! The filament-edit-profile plugin will now respect this configuration and trigger the email verification flow automatically.

Sanctum Personal Access tokens

Show the Sanctum token management component:

Please review Laravel Sanctum Docs

You may install Laravel Sanctum via the install:api Artisan command:

Sanctum allows you to issue API tokens / personal access tokens that may be used to authenticate API requests to your application. When making requests using API tokens, the token should be included in the Authorization header as a Bearer token.

Screenshot of Application Feature

If you want to control access, you can use condition, passing Closure or Boolean

Sanctum allows you to assign "abilities" to tokens. by default we have ['create', 'view', 'update', 'delete'] use permissions to customize

Browser Sessions

Screenshot of Application Feature

To utilize browser session, ensure that your session configuration's driver (or SESSION_DRIVER environment variable) is set to database.

If you want to control access or disable browser sessions, you can pass a Closure or Boolean

Multi-Factor Authentication (MFA)

This plugin integrates with Filament's native Multi-Factor Authentication (MFA) system, allowing your users to manage their MFA settings directly from the profile edit page.

Required Setup

For the MFA functionality to be available on the profile page, you must first set up MFA in your Filament panel by following the official documentation.

This typically involves running a database migration and adding the TwoFactorAuthenticatable trait to your User model. You can find the detailed instructions at the link below:

➡️ Official Filament MFA Documentation

Controlling the MFA Section's Visibility

After setting up MFA in your project, the MFA section will be displayed by default for all users. However, this plugin provides a method to dynamically control who can see and manage the MFA options.

In your panel provider file (usually app/Providers/Filament/AdminPanelProvider.php), you can use the shouldShowMultiFactorAuthentication() method in two ways:

1. Display based on a condition (Closure)

You can pass a Closure that returns true or false. The MFA section will only be displayed if the condition is met. In the example below, only the user with ID 1 will be able to see the MFA options.

2. Disable it completely

If you want to hide the MFA section for all users through the profile page, simply pass false as the argument.

Note: If the shouldShowMultiFactorAuthentication() method is not called, the default behavior is to display the MFA section for all users (equivalent to passing true), provided that the required setup has been completed correctly.

Custom Fields

Screenshot of Application Feature Optionally, you can add custom fields to the form. To create custom fields you need to follow the steps below:

  1. Publish the migration file to add the custom fields to the users table:

  2. Add in your User model the custom field in the fillable array:

  3. Add in your User model the custom field in the casts array:

  4. Publish the config file using this command:

  5. Edit the config file config/filament-edit-profile.php to add the custom fields to the form as example below:

Custom Components

If you need more control over your profile edit fields, you can create a custom component. To make this process easier, just use the artisan command.

[!NOTE] If you are not confident in using custom components, please review Filament Docs

This will generate a new app/Livewire/CustomProfileComponent.php component and a new resources/views/livewire/custom-profile-component.blade.php view which you can customize.

Now in your Panel Provider, register the new component.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-edit-profile with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0
jenssegers/agent Version ^2.6
spatie/laravel-package-tools Version ^1.15.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package joaopaulolndev/filament-edit-profile contains the following files

Loading the files please wait ....