Download the PHP package ycgambo/laravel-vue-templates without Composer
On this page you can find all versions of the php package ycgambo/laravel-vue-templates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-vue-templates
This repo is no longer maintained. :)
Laravel Vue Templates
A Laravel admin template to generate dynamic Vue tags in blades. Focus on data, not render.
Why
Though Laravel Blade and Vue are handy, we can not use them both(unless we use Vue as a library).
This leaves us two options to develop a admin site:
- use laravel as an api server and deploy another vue application
- use laravel blade engine with jquery and get ride of vue
Option 1 is the best choice if you are a full stack developer or the project itself is scaled. Option 2 is very painful for those complex admin pages.
So, thanks to the vue-admin project, I warped it so to fit backend developer's habits.
It deals with these painful stuff:
- menus (generate menu tree, detect current menu)
- async page loading(load new blade into page content with no redirect)
- vue plugins (write vue tags in blade)
Install
Install package:
composer require ycgambo/laravel-vue-templates
Add this line into your providers in config/app.php
(no need for laravel 5.8+):
Yb\LVT\ThemeServiceProvider::class,
Release resource:
php artisan vendor:publish --provider='Yb\LVT\ThemeServiceProvider'
Access hostname/lvt/VueAdmin/example/dashboard
to visit the pages.
Checkout this online Demo that I deployed on my server.
Also, there are a directory
resources/laravel-vue-templates
which copied out of this package that contains example references.
Comment out this line if you don't want those example routes:
Yb\LVT\ThemeServiceProvider::class,
Usage
Register into Blade component:
VueAdmin::create($namespace, 'example')->with('menus', $menus)->boot();
And use in blades:
The menus
is an array like this, see how to generate it:
If you want to extend the layout:
VueAdmin::create($namespace, 'example')->inject('admin.base')->with('menus', $menus)->boot();
You can then inject it by using _example
in you admin.base blade:
And use injected blades:
Route Examples
Regsiter admin routes: (app/Providers/RouteServiceProvider.php
)
The view directory tree: