https://github.com/monaye/nova-profile-resource-tools
https://github.com/monaye/nova-profile-resource-tools
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/monaye/nova-profile-resource-tools
- Owner: monaye
- Created: 2021-10-04T17:05:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-07T23:09:19.000Z (over 3 years ago)
- Last Synced: 2025-04-06T09:41:06.665Z (2 months ago)
- Language: Vue
- Size: 390 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Nova Profile Resource Tools
Laravel Nova Profile Resource Tools provide the 3 resource tools ([Resource Tools](https://nova.laravel.com/docs/3.0/customization/resource-tools.html))
1. NovaProfileInformationTools
Provide a input fields and the default controller method to update the `name` and `email` fields in the `users` table.
2. NovaPasswordTools
Allow user to update the password.
3. NovaDeleteAccountTools
Provide the functionality to delete the user account by confirming existing current password.

### Installation```bash
composer require monaye/nova-profile-resource-tools
```This package rely on the full Tailwind and recommend using the `optimistdigital/nova-tailwind`.
```
composer require optimistdigital/nova-tailwind
```### Usage
```php
use Monaye\NovaProfileResourceTools\NovaPasswordTools;
use Monaye\NovaProfileResourceTools\NovaDeleteAccountTools;
use Monaye\NovaProfileResourceTools\NovaProfileInformationTools;public function fields(Request $request)
{
return [
NovaProfileInformationTools::make('Update Profile')
->name_user($request->user()->name)
->email($request->user()->email),NovaPasswordTools::make('Change Password'),
NovaDeleteAccountTools::make('Delete Account'),
];
}
```---
## Configuring Controller
This package come with a default controller and methods to handle all 3 APIs call from the components. You could overwrite the controller@method to handle the API call instead of the default one.To user your own controller@method, first publish the config file
```
php artisan vendor:publish --tag=nova-profile-resource-tools
```Open the config file `config/nova-profile-resource-tools.php` and update.
```
[NovaProfileResourceToolsController::class, 'updateInformation'],
'handlePasswordUpdate' => [NovaProfileResourceToolsController::class, 'updatePassword'],
'handleDeleteAccount' => [NovaProfileResourceToolsController::class, 'deleteAccount'],
];```
Hope you find it useful. Feel free to reach out with feedback.
Follow me on twitter: [@winmonaye](https://twitter.com/winmonaye)
## Screenshots








