bantenprov / vue-blog
Laravel博客内容,支持vuejs。
1.0.0
2017-11-14 15:20 UTC
Requires
- php: >=5.6.4
- illuminate/support: 5.4.*
- laravelcollective/html: ^5.4.0
Requires (Dev)
- phpspec/phpspec: ~2.0
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-09-29 04:43:02 UTC
README
Laravel博客内容,支持vuejs
待办事项 :
基本博客包
此包正在开发中。
安装Laravel
$ composer create-project bantenprov/tanara:dev-dev htdocs
$ cd htdocs
$ php artisan make:auth
在layout/app.blade.php中添加以下内容
<!-- Scripts --> <script src="{{ asset('js/app.js') }}"></script> <script> var base_url = "{{ url('/') }}";</script> @stack('script')
安装VueJs
$ npm install
# latest stable
$ npm install vue
$ npm run dev
安装Vue Blog
$ composer require bantenprov/vue-blog:"1.0.0"
将包服务提供者添加到/config/app.php
中的providers
数组
// /config/app.php 'providers' => [ // Blog Package Bantenprov\VueBlog\BlogServiceProvider::class, Collective\Html\HtmlServiceProvider::class, ]; 'aliases' => [ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ];
将BlogUserTrait
添加到您的User
模型中。这将设置Eloquent关系
<?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use Bantenprov\VueBlog\Traits\BlogUserTrait; class User extends Authenticatable { use Notifiable; use BlogUserTrait; }
在resources/assets/js/app.js中修改app.js
// Vue.component('example', require('./components/Example.vue')); // // const app = new Vue({ // el: '#app' // }); Vue.component('vue-pagination', require('./components/pagination.vue'));
Artisan命令
$ php artisan vendor:publish --tag=vue_assets $ php artisan vendor:publish --tag=vue_migrations $ npm run dev $ php artisan migrate