Code Monkey home page Code Monkey logo

laravelphp-menu's Introduction

Menu

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() into register 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

laravelphp-menu's People

Contributors

hsbmaulana avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.