Giter Club home page Giter Club logo

rocketlaravelappframework's Introduction

RocketLaravelAppFramework

RocketFramework for Vue Laravel Helpers.

Installation

composer install ianrothmann/rocket-laravel-framework

In config/app.php

Service provider

IanRothmann\RocketLaravelAppFramework\ServiceProviders\RocketAppServiceProvider::class

Facades

'Rocket' =>IanRothmann\RocketLaravelAppFramework\Facades\Rocket::class

Publish the config

php artisan vendor:publish --provider="IanRothmann\RocketLaravelAppFramework\ServiceProviders\RocketAppServiceProvider"  --tag="config"

Menus

Menus can be specified in middleware, but can also be modified in any controller before passing the view.

Usage

You can give the menu a name, for instance "main", and then chain the items. The icon is optional. If you need a custom item, you can use ->custom

Rocket::menu('main')
        ->route(label,routeName,paramsArray,icon,userRightOrClosureReturningBool)
        ->route('Change Password','password.change',[],'person','user_edit')
        ->link(name,url,icon,userRightOrClosureReturningBool) 
        ->custom(RocketMenu::item("Google")->link("http://google.com")->hint('Go to Google')->icon('delete')->id('google')->target('_blank')->right(userRightOrClosureReturningBool));

Groups are also possible. Specify ->group. This returns the item. Then specify ->subMenu(), and now you can chain the items to the submenu. You need to start with Rocket::menu('main') again to add main menu items.

 Rocket::menu('main')
            ->group('Rocket CRUD')
            ->subMenu()
            ->route('CRUD Table','rocket.crud.table');
            
 Rocket::menu('main')->route('Home','home',[]);

Prepending

Sometimes one would like to prepend items (especially when modifying middleware defined menus from the controller. All item functions can start with push to prepend.

   Rocket::menu('main')->pushRoute('Home','home',[]); //pushLink, pushGroup, pushCustom etc.

Front-end

This package integrates with VueBridge and makes the menu available in $store.state.server.rocketMenus, for use with rocket-framework-menu in RocketVueAppFramework:

<rocket-framework-menu :menu="$store.state.server.rocketMenus&&$store.state.server.rocketMenus.main"></rocket-framework-menu>

Breadcrumbs

Use Rocket::breadcrumbs(), to access the BreadcrumbsService:

You may either use:

@include('rocket::breadcrumbsmenu')

to show a menu icon with the items in a menu

or

@include('rocket::breadcrumbs')

To display a classic breadcrumbs bar. Everything is only implemented in Vuetify. You cannot use both, be sure to only use one of them on a page.

in config/rocketframework.php, you may set

'breadcrumbs' => [
        'number'=>4, //Number of breadcrumbs to save
        'default'=>'show' //Default behaviour to show or hide breadcrumbs
    ]

On any page you may call: Rocket::breadcrumbs()->show() or Rocket::breadcrumbs()->hide() to bread away from the default behaviour. You can also set a namespace for the breadcrumbs to limit them on certain parts/sessions on the system. For instance: Rocket::breadcrumbs()->setBreadcrumbsNamespace($clientid)

Edit in place language

This enables you to use blade syntax @editabletext(language_line_code) or @editablehtml(language_line_code). If edit mode is active, a user will be able to edit the text in place. This is useful for public facing websites etc.

  • Use Rocket::activateLanguageEdit() or Rocket::deactivateLanguageEdit() to enter edit mode.
  • There are language configurations in app/config/rocketframework.php - mostly for the update routing. The defaults should do in most cases. - but remember the middleware for route protection. The default is [], but is should have auth and rights.
  • It used the spatie/laravel-translation-loader package to store it in a language_lines table, make sure the table exists - for more info look at their readme. You have to install the package in the project and override the service providers as in their readme.

rocketlaravelappframework's People

Contributors

ianrothmann avatar ianrothmann1 avatar

Watchers

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