PHPackages                             ycgambo/laravel-vue-templates - 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. [Templating &amp; Views](/categories/templating)
4. /
5. ycgambo/laravel-vue-templates

ActiveLibrary[Templating &amp; Views](/categories/templating)

ycgambo/laravel-vue-templates
=============================

A Laravel admin template to use Vue tags in blades

v2.5.0(6y ago)93782[1 issues](https://github.com/ycgambo/laravel-vue-templates/issues)MITBladePHP &gt;=7.0.0CI failing

Since Apr 30Pushed 4y agoCompare

[ Source](https://github.com/ycgambo/laravel-vue-templates)[ Packagist](https://packagist.org/packages/ycgambo/laravel-vue-templates)[ RSS](/packages/ycgambo-laravel-vue-templates/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (1)Versions (32)Used By (0)

This repo is no longer maintained. :)
=====================================

[](#this-repo-is-no-longer-maintained-)

Laravel Vue Templates
=====================

[](#laravel-vue-templates)

A Laravel admin template to generate dynamic Vue tags in blades. Focus on data, not render.

[中文文档](https://github.com/ycgambo/laravel-vue-templates/blob/master/README_CN.md)

Why
---

[](#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:

1. use laravel as an api server and deploy another vue application
2. 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:

1. menus (generate menu tree, detect current menu)
2. async page loading(load new blade into page content with no redirect)
3. vue plugins (write vue tags in blade)

Install
-------

[](#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](http://lvt.notee.cc/lvt/VueAdmin/example/dashboard) 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
-----

[](#usage)

Register into Blade component:

```
VueAdmin::create($namespace, 'example')->with('menus', $menus)->boot();

```

And use in blades:

```
@example

@php
    $rules = [
        'name' => 'required|min:3',
        'email' => 'required|email',
    ];
@endphp

    {{ csrf_field() }}

        Check It Out

@endexample

```

The `menus` is an array like this, [see how to generate it](#route-examples):

```
$menus = [
//  ['id' => 'menu id', 'name' => 'menu name', 'icon' => 'menu icon'，'url' => 'which url to redirect', 'sub' => 'for sub menus', ],

    ['id' => 'home', 'name' => 'Home', 'icon' => 'fa-tachometer'，'url' => '/home', ],
    ['id' => 'layout', 'name' => 'Layouts', 'icon' => 'fa-tachometer', 'sub' => [
        ['id' => 'vue-admin', 'name' => 'Vue Admin', 'icon' => 'fa-tachometer'，'url' => '/layout/vue-admin', ],
    ]],
];

```

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:

```
@_example

    @section('header')
        {{-- page css are not dynamic loaded, because there's no way to clean it up once loaded, and it will affect other pages --}}
        {{-- commonly used css --}}
    @endsection

    {{-- custom header icon slots --}}
    @section('header-lr')
    @endsection
    @section('header-rl')

    @endsection
    @section('header-rr')

    @endsection

    @section('title')
        @yield('title') {{-- expose title for subpages --}}
    @endsection

    {{ $slot }}

    @section('import')
        {{-- commonly used js --}}
    @endsection

    @section('js')
        {{-- these section will be dynamic loaded, and you can use __destructor to clean things up before load another page --}}
        @if ($errors->any())

                @foreach ($errors->all() as $error)
                    __notify("{{$error}}", 'Error', 'warning')
                @endforeach

        @endif
    @endsection
@end_example

```

And use injected blades:

```
@example

@php
    $rules = [
        'name' => 'required|min:3',
        'email' => 'required|email',
    ];

    $data = [
        'CMCC' => [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122],
        'C0CC' => [220, 182, 125, 145, 122, 191, 34, 50, 120, 110, 165, 122],
        'CUCC' => [220, 182, 125, 15, 122, 191, 134, 150, 120, 110, 165, 122],
    ];
    $data['ref'] = ["13:00", "13:05", "13:10", "13:15", "13:20", "13:25", "13:30", "13:35", "13:40", "13:45", "13:50", "13:55"];
@endphp

@section('title')
    Page No 1
@endsection

    {{ csrf_field() }}

        Washington
        Chicago

        Code
        Eat

        {!! $editor ?? '' !!}

        Check It Out

@json($data)

@section('js')
    @parent

        !(function () {
            var i = setInterval(() => {
                console.log(123)
            }, 500)
            __destructor = () => {
                clearInterval(i)
            }
        })()

@endsection

@endexample

```

Route Examples
--------------

[](#route-examples)

Regsiter admin routes: (`app/Providers/RouteServiceProvider.php`)

```
    public function map()
    {
        $this->mapApiRoutes();
        $this->mapWebRoutes();
        $this->mapAdminRoutes();
    }

    protected function mapAdminRoutes()
    {
        Route::prefix('admin')
            // ->middleware('admin')
            ->namespace("{$this->namespace}\Admin")
            ->group(base_path('routes/admin.php'));
        \Yb\LVT\Themes\VueAdmin\VueAdmin::create('admin', 'admin')
            ->inject('admin.base')
            ->with('menus', $this->getAdminMenus())
            ->paginate()
            ->boot();
    }

    protected function getAdminMenus()
    {
        $sort = [
            'index',
            'consumerMessage.manual',
        ];
        $icons = [
            'index' => 'fa-tachometer',
            'consumerMessage' => 'fa-commenting-o',
        ];
        $names = [
            'consumerMessage' => '客服消息',
            'consumerMessage.manual' => '手动发送',
            'consumerMessage.reply' => '消息回复',
        ];
        $ignores = [
            'base',
            'consumerMessage.manual_edit',
            'consumerMessage.reply_edit',
        ];

        return \Yb\LVT\Menu::in(resource_path('views/admin'))
            ->prefix('/admin')
            ->icons($icons)
            ->names($names)
            ->ignores($ignores)
            ->get($sort);
    }

```

The view directory tree:

```
resources/views/admin
├── base.blade.php
├── consumerMessage
│   ├── manual.blade.php
│   ├── manual_edit.blade.php
│   ├── reply.blade.php
│   ├── reply_edit.blade.php
└── index.blade.php

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Recently: every ~42 days

Total

30

Last Release

2267d ago

Major Versions

v1.4.3 → v2.0.02019-05-08

PHP version history (2 changes)v1.3.4PHP &gt;=7.1.0

v2.2.3PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/efa189c13b3a3fc3fb27d9c5089ca8955e0436fb7a85276878ea3d2d2f9351f4?d=identicon)[ycgambo](/maintainers/ycgambo)

---

Top Contributors

[![ycgambo](https://avatars.githubusercontent.com/u/23355083?v=4)](https://github.com/ycgambo "ycgambo (102 commits)")

---

Tags

adminbladelaravellaravel-adminvuevue-adminlaravelbladeadminvue

### Embed Badge

![Health badge](/badges/ycgambo-laravel-vue-templates/health.svg)

```
[![Health](https://phpackages.com/badges/ycgambo-laravel-vue-templates/health.svg)](https://phpackages.com/packages/ycgambo-laravel-vue-templates)
```

###  Alternatives

[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5151.4k](/packages/hasinhayder-tyro-dashboard)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
