Skip to content

vmitchell85/vue-route

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

Laravel Vue.js Route

Latest Version on Packagist Total Downloads

Laravel Vue.js Route is a macro added onto the Route class to make loading a Vue.js component as the whole view simple.

Inspired by Route::view(), which returns a blade view bypassing a controller, The Route::vue() function will, by default, load a specified Vue.js component into the default layout's content section.

Installation

You can install the package via composer:

composer require vmitchell85/vue-route

Usage

After installing the package via composer you can just call the new vue macro from the Route facade.

Route::vue('/my-route-path', 'users-index');

The macro automatically assumes you want to use the layouts.app layout file and injects the Vue.js component into the content section.

If you would like to specify the layout file and/or section you want to use additional parameters can be added:

Route::vue('/my-route-path', 'users-index', 'layouts.fancy', 'body');

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

About

A Laravel package that adds an easy way to create a route that loads a Vue.js component

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published