mawuva/laravel-user-feature-set

A set of feature related to users

1.0.0 2022-11-19 04:30 UTC

This package is auto-updated.

Last update: 2024-04-19 07:39:06 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

This packahe provide you with a set of features that you can use to enhance your work while working on the users management in your project.

Installation

You can install the package via composer:

composer require mawuva/laravel-user-feature-set

Usage

After installing the package, just run the following command:

php artisan user-feature-set:install

This command will install, setup and publish the package files in your project. It will also add two users in your database with the following credentials:

email: admin@admin.com
password: password

email: user@user.com
password: password

Features

This package will provide you the following features:

use Mawuva\UserFeatureSet\DataTransferObjects\StoreUserDTO;
use Mawuva\UserFeatureSet\Facades\UserFeatureSet;

$data = UserDTO::from([
    "name" => "Test",
    "first_name" => "Test",
    "email" => "test@example.com",
    "password" => "password",
])

// Create a new user
$user = UserFeatureSet::storeUserData($data);

// Update the existing user data
$user = UserFeatureSet::updateUserData($data);

// Check user credentials
$user = UserFeatureSet::checkUserCredentials("test@example.com");

// Change user password
$id = "1"
$user = UserFeatureSet::changeUserPassword($id, "password");

The table bellow show you the attributes that you can use in order to manipulate your user model.

Attributes
name
first_name
gender
email
password
phone_number
whatsapp_number
username
is_admin
has_agreed_with_policy_and_terms_at
last_login_at

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email seddorephraim7@gmail.com instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.