tripteki / laravelphp-menu
Trip Teknologi's Laravel.php Menus
1.0.0
2024-01-08 09:44 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 Menu 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-menu
How to use it :
-
Put
Tripteki\Menu\Providers\MenuServiceProvider
to service provider configuration list. -
Put
Tripteki\Menu\Providers\MenuServiceProvider::ignoreMigrations()
intoregister
provider, then publish migrations file into your project's directory with running (optionally) :
php artisan vendor:publish --tag=tripteki-laravelphp-menu-migrations
- Migrate.
php artisan migrate
- Sample :
use Tripteki\Menu\Contracts\Repository\Admin\IMenuAdminRepository; use Tripteki\Menu\Contracts\Repository\IMenuRepository; $menuAdminRepository = app(IMenuAdminRepository::class); // $menuAdminRepository->create([ "platform" => "desktop", "route" => "ads", "nth" => 0, "title" => "ads_gallery", "metadata" => [ "icon" => "ic-gallery", "sound" => "tones/default.mp3", ], "description" => "Gallery", ]); // // $menuAdminRepository->delete("identifier"); // // $menuAdminRepository->update("identifier", [ "platform" => "desktop", "route" => "ads", "nth" => 1, "title" => "ads_gallery", "metadata" => [ "icon" => "ic-gallery", "sound" => "tones/default.mp3", ], "description" => "Gallery", ]); // // $menuAdminRepository->activate("identifier"); // // $menuAdminRepository->deactivate("identifier"); // // $menuAdminRepository->get("identifier"); // // $menuAdminRepository->all(); // $repository = app(IMenuRepository::class); // $repository->get("desktop", "ads", 5); // // $repository->all("web", "ads"); // // $repository->all("mobile", "ads"); // // $repository->all("desktop", "ads"); //
- Generate swagger files into your project's directory with putting this into your annotation configuration (optionally) :
base_path("app/Http/Controllers/Menu")
base_path("app/Http/Controllers/Admin/Menu")
Usage
php artisan adminer:install:menu
Author
- Trip Teknologi (@tripteki)
- Hasby Maulana (@hsbmaulana)