namvoyager / simple-user-management
User management.
Requires
- php: ^8.2
- ext-json: *
- illuminate/collections: ^11.0
- illuminate/console: ^11.0
- illuminate/contracts: ^11.0
- illuminate/database: ^11.0
- illuminate/log: ^11.0
- illuminate/support: ^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: dev-master
- laravel/pint: dev-main
This package is auto-updated.
Last update: 2024-05-07 10:07:39 UTC
README
Installation
Install using composer:
composer require namvoyager/simple-user-management
Publish and install initial resources
php artisan user-management:install
Customize and override vendor logic
To customize the logic of the user management feature, you can open the app/Http/Controllers/UserController
file.
Here the controller will use UserRepository
to handle logic.
namespace App\Http\Controllers; use VoyagerInc\SimpleUserManagement\Contracts\UserRepository; class UserController extends Controller { public function __construct( protected UserRepository $users, ) { } }
To be able to inherit or override VoyagerInc\SimpleUserManagement\Repositories\UserRepository
,
you can define a new App\Repositories\UserRepository
class and implement
VoyagerInc\SimpleUserManagement\Contracts\UserRepository
.
Then go to app\Providers\SimpleUserManagementServiceProvider
to declare,
now you can replace the UserRepository
class of the vendor.
First, define a new UserRepository
in path app\Repositories
.
namespace App\Repositories; use VoyagerInc\SimpleUserManagement\Contracts\UserRepository as UserRepositoryContract; class UserRepository implements UserRepositoryContract { // Override all the methods of the interface here. }
Then, go to app\Providers\SimpleUserManagementServiceProvider.php
.
use VoyagerInc\SimpleUserManagement\Contracts\UserRepository as UserRepositoryContract; use App\Repositories\UserRepository; public function register() { $this->app->singleton(UserRepositoryContract::class, UserRepository::class); }
Custom view
User management view files are located in the path resources/views/users/
.
Corresponding to each screen there will be files: index.blade.php
, create.blade.php
, show.blade.php
, edit.blade.php