Download the PHP package riverskies/laravel-vue-component without Composer

On this page you can find all versions of the php package riverskies/laravel-vue-component. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-vue-component

Laravel Vue Component

A helper package to aid working with Vue Components in a (non-SPA) Laravel environment. This package makes injecting page-specific Vue Components a breeze.

Sometimes we come across situations where the project is not using Vue extensively, but some pages could highly benefit from it being present. This package aims at those scenarios and makes it possible to (optionally) wrap pages with dedicated Vue components directly from your PHP backend.

When would you use this package?

When building a multi-page application there is often a need to inject some Vue magic into specific pages. However, more often then not, as the project grows, the individual script tags get out of control and become very hard to manage.

How does this package work?

The package implements a new Blade directive that you can safely use to wrap your yielded content in your Blade templates. By using this new directive you are able to inject a custom, page-specific Vue component into any of your pages while keeping your scripts modular therefore manageable at the same time.

Installation

NOTE - For those with Laravel 5.2 or before: please use v1.0.2 instead!!!

Install the package through composer:

If you're running Laravel 5.4 or earlier, add the service provider to your config/app.php file:

Usage

Wrap your yield block in your layout file with the new directive:

If you have $component variable set on your view...

...the content will be wrapped within a dynamic Vue component:

To inject the homepage component dynamically, you will need to have the set component (homepage) available on your root Vue instance. For example, your app.js file might look like this:

Examples

1. Simple page injection

An example where you connect a blade template to a Vue page instance. Consider following scenario...

In your controller method:

In your pages.contact.blade file (note the wrapping <div> and the escaped @{{ ... }} syntax):

In your pages/contact.js file:

And your main app.js file to be like this:

With above, you are successfully injected VueJS control into your contact page.

2. Sending through data

Based on Example 1, you can send through data from the backend directly as well. Consider following scenario...

In your controller method:

In your pages/contact.js file:

This method can be used to send through data from the backend directly.


All versions of laravel-vue-component with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^5.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package riverskies/laravel-vue-component contains the following files

Loading the files please wait ....