Giter Club home page Giter Club logo

aee-route-generator's Introduction

Route Generator

This is developed for larabase. This package is one of core packages of larabase which is responsible for creating dynamic routes for modules with a single file.

⚠️ Warnings

  • Every module should have route_generator.php

Usage/Examples

In below, you'll see some commands and usage example of the package. First step create a route_generator.php file at the root of the module folder. Route_generator.php file should contains your route information which you would like show users. You should determine title, permission, data-feather-icon, routes as a required properties.

Nested Route

There are two types of route that we support for now. One of them is nested route which is collapsable. As you can see there is a permission under the title, I will be referring it as a global permission. Under the routes key, you can see two type of usage One of them is an array format to determine title, route and permission. In this case title and route are required but permission is optional property Another one is just route using url or route (you can also use laravel helper functions)

<?php

return [
        "title" => "User Management",
        "permission" => "user_access",
        "data-feather-icon" => "users",
        "routes" => [
            [
                "title" => "Users",
                "route" => url("/user-management/users"),
                "permission" => "user_access"
            ],
            [
                "title" => "Roles",
                "route" => url("/user-management/roles"),
                "permission" => "role_access"
            ],
            "Permissions" => url("/user-management/permissions")
        ],
  ];

Single Route

Single route is consist of title, permission, data-feather-icon and routes same as nested route. Difference between nested and single is single route is not collapsable in the sidebar. It consist of just one route as below.

<?php

return [
    "title" => "User Management",
    "permission" => "user_access",
    "data-feather-icon" => "users",
    "routes" => url("/user-management/permissions")
  ];

Generate Dynamic Routes

To generate dynamic routes, you can use :

$ php artisan larabase:generate-routes  

Authors

🚀 About Me

I'm a full stack web developer who is also student at Collegium Da Vinci (CDV) in Poznan/Poland.

aee-route-generator's People

Contributors

alpemreelmas avatar

Watchers

Lucian avatar  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.