https://github.com/vmitchell85/vue-route
A Laravel package that adds an easy way to create a route that loads a Vue.js component
https://github.com/vmitchell85/vue-route
laravel package vuejs
Last synced: about 2 months ago
JSON representation
A Laravel package that adds an easy way to create a route that loads a Vue.js component
- Host: GitHub
- URL: https://github.com/vmitchell85/vue-route
- Owner: vmitchell85
- License: mit
- Created: 2019-02-04T03:04:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-04T03:29:36.000Z (over 7 years ago)
- Last Synced: 2025-03-08T10:58:50.426Z (over 1 year ago)
- Topics: laravel, package, vuejs
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Vue.js Route
[](https://packagist.org/packages/vmitchell85/vue-route)
[](https://packagist.org/packages/vmitchell85/vue-route)
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:
```bash
composer require vmitchell85/vue-route
```
## Usage
After installing the package via composer you can just call the new `vue` macro from the `Route` facade.
``` php
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:
``` php
Route::vue('/my-route-path', 'users-index', 'layouts.fancy', 'body');
```
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Vincent Mitchell](https://github.com/vmitchell85)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Laravel Package Boilerplate
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).