PHPackages                             vhanla/laravel-vue-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vhanla/laravel-vue-cli

ActivePackage[Utility &amp; Helpers](/categories/utility)

vhanla/laravel-vue-cli
======================

Laravel Vue Cli preset and integration

6661PHP

Since Oct 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vhanla/laravel-vue-cli)[ Packagist](https://packagist.org/packages/vhanla/laravel-vue-cli)[ RSS](/packages/vhanla-laravel-vue-cli/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel 5 Vue Cli integration
=============================

[](#laravel-5-vue-cli-integration)

This package includes a preset that will modify a fresh Laravel 5.7 installation. It allows you to use Vue-cli along Laravel. It will also let you include them in your blade views, any assets generated by vue-cli-service.

Installation
------------

[](#installation)

With Composer

`$ composer require vhanla/laravel-vue-cli`

Next, add service provider into your `config/app.php` file in `providers` section:

- `Vhanla\VueCli\VuecliServiceProvider::class,`

Configuration
-------------

[](#configuration)

To change package configuration you need to publish configuration files:

`$ php artisan vendor:publish`

This will publish `vuecli.php` file inside your `config` directory.

Usage
-----

[](#usage)

- First create a `vue` project **inside `resources` directory** using `vue cli`, it is recommended not to use git e.g. `vue create --no-git `
- Once finished creation of `vue` project using Vue-Cli, execute the `vuecli` preset: `php artisan preset vuecli` and follow the interactive setup. The preset command will detect `vue` project inside `resources` directory. Then it will ask you to pick it.
- `Blade` views has two methods to invoke assets.

    - Development method: This method is better when we are developing. ``

        It allows to always read generated `assets.json` file contents even from cached views. Recommended only for local development mode, specially when using `hashed` filenames.
    - Cacheable method: This method is better for production mode. ``

        Once `blade` view is cached, the returned assets path will always be the same, until the `blade` template file is modified or `php artisan view:clear` is invoked.

    In other words, the first one will always read `public/assets.json` file in order to find out the specific `asset` file, while the latter will only read once before caching. Even clearer, with the first one, cached `blade` views will include `
