tripteki / laravelphp-setting
Trip Teknologi's Laravel.php Settings
1.0.3
2024-10-21 02:48 UTC
Requires
- php: ^8.0.2
- tripteki/laravelphp-adminer: ^1.0.0
- tripteki/laravelphp-helpers: ^1.0.0
- tripteki/laravelphp-import-export: ^1.0.0
- tripteki/laravelphp-repository: ^1.0.0
- tripteki/laravelphp-request-response-query: ^1.0.0
Suggests
- laravel/framework: Required when using laravel framework (^9.0).
- laravel/lumen-framework: Required when using lumen framework (^9.0).
README
This package provides implementation of setting in repository pattern for Lumen and Laravel besides REST API starterpack of admin management with no intervention to codebase and keep clean.
Getting Started
Installation :
composer require tripteki/laravelphp-setting
How to use it :
-
Put
Tripteki\Setting\Providers\SettingServiceProvider
to service provider configuration list. -
Put
Tripteki\Setting\Providers\SettingServiceProvider::ignoreMigrations()
intoregister
provider, then publish migrations file into your project's directory with running (optionally) :
php artisan vendor:publish --tag=tripteki-laravelphp-setting-migrations
- Migrate.
php artisan migrate
- Publish tests file into your project's directory with running (optionally) :
php artisan vendor:publish --tag=tripteki-laravelphp-setting-tests
- Sample :
use Tripteki\Setting\Contracts\Repository\Admin\ISettingRepository as ISettingAdminRepository; use Tripteki\Setting\Contracts\Repository\ISettingRepository; $settingAdminRepository = app(ISettingAdminRepository::class); // $settingAdminRepository->create([ "key" => "key", "value" => "...", ]); // // $settingAdminRepository->delete("key"); // // $settingAdminRepository->update("key", [ "value" => "...", ]); // // $settingAdminRepository->get("key"); // // $settingAdminRepository->all(); // $repository = app(ISettingRepository::class); // $repository->setUser(...); // // $repository->getUser(); // // $repository->setup("key", "value"); // // $repository->setdown("key"); // // $repository->all(); //
- Generate swagger files into your project's directory with putting this into your annotation configuration (optionally) :
base_path("app/Http/Controllers/Setting")
base_path("app/Http/Controllers/Admin/Setting")
Usage
php artisan adminer:install:setting
Author
- Trip Teknologi (@tripteki)
- Hasby Maulana (@hsbmaulana)