All Projects → samturrell → vue-laroute

samturrell / vue-laroute

Licence: MIT license
Wrapper for injecting laravel routes into your vue application

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-laroute

Express Env Example
A sample express environment that is well architected for scale. Read about it here:
Stars: ✭ 130 (+465.22%)
Mutual labels:  routes
intelliroutes
Support for Play Routes in IntelliJ IDEA
Stars: ✭ 21 (-8.7%)
Mutual labels:  routes
railways
A plugin for RubyMine and IntelliJ IDEA Ultimate that adds a panel with routes of Ruby on Rails application.
Stars: ✭ 44 (+91.3%)
Mutual labels:  routes
Php Whois
PHP WHOIS provides parsed and raw whois lookup of domains and ASN routes. PHP 5.4+ and 7+ compatible
Stars: ✭ 179 (+678.26%)
Mutual labels:  routes
hapi-routes
Hapi plugin for registering routes
Stars: ✭ 12 (-47.83%)
Mutual labels:  routes
radlkarte
Hand-crafted routing information for cyclists
Stars: ✭ 14 (-39.13%)
Mutual labels:  routes
Universal Router
A simple middleware-style router for isomorphic JavaScript web apps
Stars: ✭ 1,598 (+6847.83%)
Mutual labels:  routes
Xposer
A Kubernetes controller to manage (create/update/delete) Kubernetes Ingresses based on the Service - [✩Star] if you are using it!
Stars: ✭ 30 (+30.43%)
Mutual labels:  routes
umi-plugin-menus
将 umi 生成的 routes 转换成 tree 结构 menus 数据,开发中可直接引入该文件来进行导航菜单的生成
Stars: ✭ 29 (+26.09%)
Mutual labels:  routes
zuul-route-jdbc-spring-cloud-starter
No description or website provided.
Stars: ✭ 23 (+0%)
Mutual labels:  routes
Ziggy
Use your Laravel named routes in JavaScript
Stars: ✭ 2,619 (+11286.96%)
Mutual labels:  routes
vue-error-page
[NO LONGER MAINTAINED] Provides a wrapper for router-view that allows you to show error pages without changing the URL.
Stars: ✭ 52 (+126.09%)
Mutual labels:  routes
type-arango
🥑 TypeArango manages ArangoDB collections, documents, relations and routes by taking advantage of TypeScript typings.
Stars: ✭ 55 (+139.13%)
Mutual labels:  routes
Laravel Router
An organized approach to handling routes in Laravel.
Stars: ✭ 130 (+465.22%)
Mutual labels:  routes
fastify-register-routes
Plugin to automatically load routes from a specified path and optionally limit loaded file names by a regular expression.
Stars: ✭ 15 (-34.78%)
Mutual labels:  routes
Slim Oauth2
Routes and Middleware for Using OAuth2 Server within a Slim Framework API
Stars: ✭ 121 (+426.09%)
Mutual labels:  routes
fastify-loader
The route loader for the cool kids!
Stars: ✭ 17 (-26.09%)
Mutual labels:  routes
laroute
Generate Laravel route URLs from JavaScript.
Stars: ✭ 33 (+43.48%)
Mutual labels:  routes
feathers-versionate
Create and work with nested services.
Stars: ✭ 29 (+26.09%)
Mutual labels:  routes
ertuo
Ertuo: quick routing for PHP
Stars: ✭ 29 (+26.09%)
Mutual labels:  routes

vue-laroute

npm vue2

Inject Laravel routes into your Vue application via aaronlord/laroute. I actually recommend the alternative and more slim-lined version of this package from AXN-Informatique/laravel-laroute.

DEMO

Using this plugin

Adding vue-laroute to your application is as simple as any other plugin:

import Vue from 'vue';

import VueLaroute from 'vue-laroute';
import routes from '../path/to/laroute.js';

Vue.use(VueLaroute, {
  routes,
  accessor: '$routes', // Optional: the global variable for accessing the router
});

new Vue({
  el: '#app',
});

You can now access your global accessor ($routes by default) in any component via this.$routes, for example:

<template>
  <div>
    <h1>You can access it in your template</h1>
    <nav>
      <ul>
        <li>
          <a :href="$routes.route('home')">Home</a>
        </li>
        <li>
          <a :href="$routes.route('products')">Home</a>
          <ul>
            <li>
              <a :href="$routes.route('products.show', { id: 1 })">Product 1</a>
            </li>
            <li>
              <a :href="$routes.route('products.show', { id: 123 })">Product 123</a>
            </li>
          </ul>
        </li>
      </ul>
    </nav>
    <button @click.prevent="purchaseProduct(123)">Purchase product</button>
  </div>
</template>

<script>
  export default {
    methods: {
      purchaseProduct (id) {
        this.$http.post(this.$routes.route('products.purchase', { id: id }))
          .then((response) => {
            // Handler
          });
      },
    },
  }
</script>

📜 Changelog

Details changes for each release are documented in the CHANGELOG.md.

Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

💪 Contribution

Please make sure to read the Contributing Guide before making a pull request.

©️ License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].