exolnet/laravel-vue-data

Adds utilities to easily pass data from Laravel to Vue.
28,064
Install
composer require exolnet/laravel-vue-data
Latest Version:v1.11.0
PHP:^8.3
Laravel:12 · 13
Older releases:6 – 11
License:MIT
Last Updated:Sep 30, 2026
Links: GitHub  ·  Packagist
Maintainer: exolnet

laravel-vue-data

Latest Stable Version Software License Build Status Total Downloads

Adds utilities to easily pass data from Laravel to Vue.

Installation

Require this package with composer:

composer require exolnet/laravel-vue-data

If you don't use package auto-discovery, add the service provider to the providers array in config/app.php:

Exolnet\VueData\VueDataServiceProvider::class

And the facade to the facades array in config/app.php:

'Vue' => Exolnet\VueData\Facades\Vue::class

Usage

Define variables

First, you need to devine variable that will be available in your Vue application.

In your PHP code:

Vue::put('variable', 'value')

In a Blade view:

@vue('variable', 'value')

Make variables available

In your base layout, add the following view before your main app.js to make the variables available:

@include('vue-data::variables')

Use variables

In your app.js, use the variables defined when they are available:

new Vue({
    el: '#app',
    data: () => window.App || {},
});

Testing

To run the phpUnit tests, please use:

composer test

Contributing

Please see CONTRIBUTING and CODE OF CONDUCT for details.

Security

If you discover any security related issues, please email security@exolnet.com instead of using the issue tracker.

Credits

License

Copyright © eXolnet. All rights reserved.

This code is licensed under the MIT license. Please see the license file for more information.

Related Packages

exolnet/laravel-status

The eXolnet Laravel Status package.

56,972 0
exolnet/laravel-translation

The eXolnet Laravel Translation package.

32,932 3
exolnet/laravel-sqlite-fluent-drop-foreign

Add a fluent dropForeign when using sqlite database

135,015 12
exolnet/laravel-backup-database

Expend laravel-backup by adding a simple command to backup a database.

50,288 0
exolnet/laravel-envoy

Automated deployment template for Laravel Envoy based on Capistrano.

18,357 23

Version History

Version Released PHP Laravel License
v1.11.0 ^8.3 ^12.0|^13.0 MIT
v1.10.0 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.9.0 ^8.2 ^11.0|^12.0 MIT
v1.8.0 ^8.2 ^11.0|^12.0 MIT
v1.7.0 ^8.1 ^10.0|^11.0 MIT