bantenprov/vue-blog

Laravel blog content with vuejs support.

1.0.0 2017-11-14 15:20 UTC

This package is not auto-updated.

Last update: 2024-07-07 03:33:07 UTC


README

Vue Blog

Join the chat at https://gitter.im/vue-blog/Lobby Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

Laravel blog content with vuejs suport

TODO : :

Basic Blog Package

This package is under development.

Install Laravel :

$ composer create-project bantenprov/tanara:dev-dev htdocs
$ cd htdocs
$ php artisan make:auth

add in layout/app.blade.php after

<!-- Scripts -->
<script src="{{ asset('js/app.js') }}"></script>
<script>  var base_url = "{{ url('/') }}";</script>
@stack('script')

Install VueJs :

$ npm install
# latest stable
$ npm install vue
$ npm run dev

Install Vue Blog :

$ composer require bantenprov/vue-blog:"1.0.0"

Add the package service provider to the providers array on /config/app.php:

// /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,
];

Add the BlogUserTrait to your User model. This sets up Eloquent relationships:

<?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;

}

Change app.js in resources/assets/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 command :

$ php artisan vendor:publish --tag=vue_assets
$ php artisan vendor:publish --tag=vue_migrations
$ npm run dev
$ php artisan migrate