Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mawuva committed Aug 13, 2021
1 parent 5a01f79 commit e79be56
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 39 deletions.
153 changes: 134 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Very short description of the package
# Usercase - A Users Management Package that includes many features arround user

[![Latest Version on Packagist](https://img.shields.io/packagist/v/mawuekom/laravel-usercare.svg?style=flat-square)](https://packagist.org/packages/mawuekom/laravel-usercare)
[![Total Downloads](https://img.shields.io/packagist/dt/mawuekom/laravel-usercare.svg?style=flat-square)](https://packagist.org/packages/mawuekom/laravel-usercare)
![GitHub Actions](https://github.com/mawuekom/laravel-usercare/actions/workflows/main.yml/badge.svg)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
This package provide a bunch of features that will help implement users management in your laravel project.

## Installation

Expand All @@ -16,10 +12,141 @@ composer require mawuekom/laravel-usercare

## Usage

Once install, go to `config/app.php` to add `UsercareServiceProvider` in providers array

Laravel 5.5 and up Uses package auto discovery feature, no need to edit the `config/app.php` file.

- #### Service Provider

```php
'providers' => [

...

Mawuekom\Usercare\UsercareServiceProvider::class,

],
```

- #### Publish Assets

```bash
php artisan vendor:publish --tag=usercare
```

Or you can publish config

```bash
php artisan vendor:publish --tag=usercare --config
```

#### Configuration

* You can change connection for models, models path and there is also a handy pretend feature.
* There are many configurable options which have been extended to be able to configured via `.env` file variables.
* Editing the configuration file directly may not needed because of this.
* See config file: [usercare.php](https://github.com/mawuva/laravel-usercare/blob/main/config/usercare.php).

```php
// Usage description here
<?php

/*
* You can place your custom package configuration in here.
*/
return [
'separator' => '.',

/*
|--------------------------------------------------------------------------
| USERCARE feature settings
|--------------------------------------------------------------------------
*/

'account_type' => [
'enable' => true,
'name' => 'Account Type',
'resource_name' => 'account_type',
'model' => null,

'table' => [
'name' => env('USERCARE_ACCOUNT_TYPES_DATABASE_TABLE', 'account_types'),
'primary_key' => env('USERCARE_ACCOUNT_TYPES_DATABASE_TABLE_PRIMARY_KEY', 'id'),
],
],

'user' => [
'model' => App\Models\User::class,
'name' => 'User',
'resource_name' => 'user',

'table' => [
'name' => env('USERCARE_USERS_DATABASE_TABLE', 'users'),
'primary_key' => env('USERCARE_USERS_DATABASE_TABLE_PRIMARY_KEY', 'id'),
'account_type_foreign_key' => env('USERCARE_USERS_DATABASE_TABLE_ACCOUNT_TYPE_FOREIGN_KEY', 'account_type_id'),
],
],

'user_profile' => [
'enable' => true,
'model' => null,

'table' => [
'name' => env('USERCARE_PROFILES_DATABASE_TABLE', 'profiles'),
'primary_key' => env('USERCARE_PROFILES_DATABASE_TABLE_PRIMARY_KEY', 'id'),
'user_foreign_key' => env('USERCARE_PROFILES_DATABASE_TABLE_USER_FOREIGN_KEY', 'user_id'),
],
],

'user_profile_picture' => [
'enable' => true,
'model' => null,

'table' => [
'name' => env('USERCARE_PROFILE_PICTURES_DATABASE_TABLE', 'profile_pictures'),
'primary_key' => env('USERCARE_PROFILE_PICTURES_DATABASE_TABLE_PRIMARY_KEY', 'id'),
'user_foreign_key' => env('USERCARE_PROFILE_PICTURES_DATABASE_TABLE_USER_FOREIGN_KEY', 'user_id'),
],

'default' => [
'file_source_url' => url('/'),
'avatar' => asset('/'), // asset('default-avatar.png')
'bg_picture' => asset('/'), // asset('default-bg-picture.png')
],
],

'password_history' => [
'checker' => false,
'number_to_check' => 3,
],

/*
|--------------------------------------------------------------------------
| Bunch of features to enable or disable.
|--------------------------------------------------------------------------
*/

'enable' => [
'proper_names' => true,
'email_optionality' => false,
'phone_number' => true,
'gender' => true,
],

/*
|--------------------------------------------------------------------------
| Add uuid support
|--------------------------------------------------------------------------
*/

'uuids' => [
'enable' => true,
'column' => '_id'
],
];
```

## The rest is coming soon

### Testing

```bash
Expand All @@ -34,19 +161,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits

- [Ephraïm Seddor](https://github.com/mawuekom)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Laravel Package Boilerplate

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).
20 changes: 0 additions & 20 deletions src/UsercareServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,12 @@ public function boot()
* Optional methods to load your package assets
*/
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'usercare');
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'usercare');
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
// $this->loadRoutesFrom(__DIR__.'/routes.php');

if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/usercare.php' => config_path('usercare.php'),
], 'config');

// Publishing the views.
/*$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/usercare'),
], 'views');*/

// Publishing assets.
/*$this->publishes([
__DIR__.'/../resources/assets' => public_path('vendor/usercare'),
], 'assets');*/

// Publishing the translation files.
/*$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/usercare'),
], 'lang');*/

// Registering package commands.
// $this->commands([]);
}
}

Expand Down

0 comments on commit e79be56

Please sign in to comment.