davide-casiraghi/laravel-smart-blog

A smart multi language blog package for Laravel.

1.0.9 2019-06-27 05:52 UTC

This package is auto-updated.

Last update: 2024-11-08 16:53:18 UTC


README

Latest Version on Packagist Build Status Quality Score Coverage Status GitHub last commit

A multi language blog package for Laravel.

Installation

You can install the package via composer:

composer require davide-casiraghi/laravel-smart-blog

Then install Bricklayer.js trough npm

npm install bricklayer  

Authorization

To work the package aspect that in your user model and table you have a field called group that can have this possible values:

  • null: Registered user
  • 1: Super Admin
  • 2: Admin

Just the users that have Admin and Super admin privileges can access to the routes that allow to create, edit and delete the blogs, categories and posts. Otherwise you get redirected to the homepage.

Load the CSS and JS files

With Laravel

Publish the JS, CSS and IMAGES

It's possible to customize the scss and the js publishing them in your Laravel application.

php artisan vendor:publish

This command will publish in your application this folders:

  • /resources/scss/vendor/laravel-smart-blog/
  • /resources/js/vendor/laravel-smart-blog/

In this way it's possible for you to customize them.

Run the migration

php artisan migrate

To create the gallery_images table in your database.

Load the JS file

Run in the command line:
npm i prismjs

In the resources/js/app.js file of your application require the Bricklayer and bricklayerBlogLayout.js files before the Vue object get instanciated:

require('./bootstrap');
window.Vue = require('vue');

window.Bricklayer = require('bricklayer');
require('./vendor/laravel-smart-blog/bricklayerBlogLayout');

window.myApp = new Vue({  
    el: '#app'
});

import 'prismjs';

In the resources/sass/app.scss file of your application import the scss

@import 'vendor/laravel-smart-blog/bricklayerBlogLayout';

Then you can run Laravel Mix

npm run dev

Usage

After the package is published it adds three new routes:

  • /blogs
  • /categories
  • /posts

Accessing to this routes you can create new blogs, categories and posts and access to them.

Testing

You can run unit tests checking the code coverage using this command.

./vendor/bin/phpunit --coverage-html=html 

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email davide.casiraghi@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.