From c2a9620c7ec1d5d76f791abd69d294bfdd631872 Mon Sep 17 00:00:00 2001 From: hsbmaulana Date: Sun, 29 Jan 2023 00:24:54 +0700 Subject: [PATCH] build(core): initial --- .github/workflows/cd.yml | 17 +++++ LICENSE | 21 ++++++ README.md | 94 ++++++++++++++++++++++++ composer.json | 49 ++++++++++++ config/adminer.php | 38 ++++++++++ src/Providers/AdminerServiceProvider.php | 63 ++++++++++++++++ 6 files changed, 282 insertions(+) create mode 100644 .github/workflows/cd.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 composer.json create mode 100644 config/adminer.php create mode 100644 src/Providers/AdminerServiceProvider.php diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..2ea088a --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,17 @@ +name: Laravel.php Adminer + +on: push + +jobs: + cd: + runs-on: ubuntu-latest + steps: + - name: cd + uses: tripteki/cd-package@1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repotoken: ${{ secrets.REPOSITORY_TOKEN }} + repouser: tripteki + repository: https://packagist.org + language: php + artifact: composer.json \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..061b3a5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Trip Teknologi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3b2f7b9 --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +

Adminer

+ +This package provides drivers, helpers, repositories, endpoints starterpack implementation of basic features for facilitate developing admin menagement modules in your codebase, built by applying (concepts) like `Test Driven Development` `Event-Listener Driven Development` `Async-like (Queue)` `Cached`, (design principle) `RESTful API` `Tight Cohesion & Loose Coupling` `SOLID`, (design pattern) `Gangs of Four (GoF) Repository Pattern`.
+Click one of packages and follow the instruction to get started. + +### 📃 Packages + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NoRepositoryDescription
1 + laravelphp-user
+
User Management
2 + laravelphp-setting
+
Setting Management
3 + laravelphp-setting-profile
+
Setting per-User Variable Environment Management
4 + laravelphp-setting-locale
+
Setting per-User i18n Management
5 + laravelphp-setting-menu
+
Setting per-User Menu Management
6 + laravelphp-acl
+
Access Control List (granted or denied) Management
7 + laravelphp-log
+
Logging Management
8 + laravelphp-notification
+
Notification Management
+ +Getting Started +--- + +Installation : + +``` +$ composer require tripteki/laravelphp-adminer +``` + +How to use it : + +- Put `Tripteki\Adminer\Providers\AdminerServiceProvider` to service provider configuration list. + +- Put `Tripteki\Adminer\Providers\AdminerServiceProvider::ignoreConfig()` into `register` provider, then publish config file into your project's directory with running (optionally) : + +``` +php artisan vendor:publish --tag=tripteki-laravelphp-adminer-configs +``` + +Author +--- + +- Trip Teknologi ([@tripteki](https://linkedin.com/company/tripteki)) +- Hasby Maulana ([@hsbmaulana](https://linkedin.com/in/hsbmaulana)) diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..98a4fe2 --- /dev/null +++ b/composer.json @@ -0,0 +1,49 @@ +{ + "name": "tripteki/laravelphp-adminer", + "version": "1.0.0", + "description": "Trip Teknologi's Laravel.php Adminer", + + "readme": "README.md", + "license": "MIT", + "authors": [ { "name": "Trip Teknologi", "email": "tripteki.company@gmail.com" } ], + "homepage": "https://github.com/tripteki/laravelphp-adminer", + "support": { "issues": "https://github.com/tripteki/laravelphp-adminer/issues" }, + + "require": { + + "php": "^8.0.2" + }, + + "require-dev": {}, + + "suggest": { + + "laravel/lumen-framework": "Required when using lumen framework (^9.0).", + "laravel/framework": "Required when using laravel framework (^9.0)." + }, + + "autoload": { + + "psr-4": { + + "Tripteki\\Adminer\\": "src/" + } + }, + + "autoload-dev": {}, + + "extra": { + + "laravel": { + + "dont-discover": [], + + "providers": [ + + "Tripteki\\Adminer\\Providers\\AdminerServiceProvider" + ], + + "aliases": [] + } + } +} diff --git a/config/adminer.php b/config/adminer.php new file mode 100644 index 0000000..43a75b4 --- /dev/null +++ b/config/adminer.php @@ -0,0 +1,38 @@ + [ + + /* + * Route prefix for admin scope. + */ + "admin" => "admin", + + /* + * Route prefix for user scope. + */ + "user" => null, // "auth:web" // + ], + + /* + * Middleware. + */ + "middleware" => [ + + /* + * Middleware for admin scope. + */ + "admin" => [ "api", ], + + /* + * Middleware for user scope. + */ + "user" => [ "api", "auth:api", ], + ], +]; diff --git a/src/Providers/AdminerServiceProvider.php b/src/Providers/AdminerServiceProvider.php new file mode 100644 index 0000000..164d1c9 --- /dev/null +++ b/src/Providers/AdminerServiceProvider.php @@ -0,0 +1,63 @@ +registerConfigs(); + $this->registerPublishers(); + } + + /** + * @return void + */ + protected function registerConfigs() + { + if (static::shouldLoadConfig()) { + + $this->mergeConfigFrom(__DIR__."/../../config/adminer.php", "adminer"); + } + } + + /** + * @return void + */ + protected function registerPublishers() + { + $this->publishes( + [ + __DIR__."/../../config/adminer.php" => config_path("adminer.php"), + ], + + "tripteki-laravelphp-adminer-configs"); + } +};