This package provides implementation of user in repository pattern for Lumen and Laravel besides REST API starterpack of admin management with no intervention to codebase and keep clean.
Installation :
composer require tripteki/laravelphp-user
How to use it :
-
Put
Tripteki\User\Providers\UserServiceProvider
to service provider configuration list. -
Put
Tripteki\User\Providers\UserServiceProvider::ignoreMigrations()
intoregister
provider, then publish migrations file into your project's directory with running (optionally) :
php artisan vendor:publish --tag=tripteki-laravelphp-user-migrations
- Migrate.
php artisan migrate
- Sample :
use Tripteki\User\Contracts\Repository\Admin\IUserRepository as IUserAdminRepository;
$userAdminRepository = app(IUserAdminRepository::class);
// $userAdminRepository->create([ "name" => "...", "email" => "...", "password" => "...", ]); //
// $userAdminRepository->delete("identifier"); //
// $userAdminRepository->update("identifier", [ "name" => "...", "email" => "...", "password" => "...", ]); //
// $userAdminRepository->get("identifier"); //
// $userAdminRepository->all(); //
- Generate swagger files into your project's directory with putting this into your annotation configuration (optionally) :
base_path("app/Http/Controllers/Admin/User")
php artisan adminer:install:user
and put App\Console\Commands\GenerateUserCommand::class
to register kernel.
php artisan adminer:generate:user
- Trip Teknologi (@tripteki)
- Hasby Maulana (@hsbmaulana)