retosteffen/laravel-blog

A simple blog that you can add to your laravel app

0.3.1 2020-02-21 13:46 UTC

This package is auto-updated.

Last update: 2024-04-12 19:13:08 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

If you need to add a simple blog to an existing laravel application this might be for you. Views are kept very barebones on purpose so that you can easily add your existing styles.

Any registered user of your app will be able to add/edit/delete blog posts, categories and tags.

SEO for blog post should be ok

This package is not a full laravel application! It only allows you to add a simple blog to the laravel application that you already have.

Installation

You can install the package via composer:

add this to your composer.json in your "repositories" array

{
    "type": "vcs",
    "url": "https://github.com/retosteffen/laravel-tags"
}
composer require retosteffen/laravel-blog

For image upload run

php artisan storage:link

requires laravel auth https://laravel.com/docs/6.x/authentication

included packages (will be added automatically)

"spatie/laravel-sluggable": "^2.2",
"spatie/laravel-tags": "dev-master",
"laravel/helpers": "^1.1",

more info about those packages here:

https://github.com/spatie/laravel-sluggable

https://github.com/spatie/laravel-tags

note: This packages uses a slighty modified version of spatie/laravel-tags

Migrations

php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Retosteffen\LaravelBlog\LaravelBlogServiceProvider" --tag="laravel-blog:migrations"
php artisan migrate

Views

The views are very barebones so you will probably want to edit them and add your own styles

php artisan vendor:publish --provider="Retosteffen\LaravelBlog\LaravelBlogServiceProvider" --tag="laravel-blog:views"

layout.blade.php template is easily editable to fit the style of your application but should include:

<title>@yield('title')</title>
@yield('meta')
@yield('content')
@yield('javascript')

Translations

Translations for french and german are included.

php artisan vendor:publish --provider="Retosteffen\LaravelBlog\LaravelBlogServiceProvider" --tag="laravel-blog:lang"

Config

To configure the path of the blog and the permalink structure

php artisan vendor:publish --provider="Retosteffen\LaravelBlog\LaravelBlogServiceProvider" --tag="laravel-blog:config"
return [
  'route' => "/blog",
  'adminroute' => "/blog_admin",
  'blog_name'=>'My blog',
  'blog_description'=>"A demo blog built with laravel-blog",
  'permalink' => "slug", //options are id, year/month/slug, year/month/day/slug, slug
  'locale'=>'en_US',
  'facebook_name'=>"YOUR FACEBOOK PAGE URL",
  'twitter_handle'=>"YOUR TWITTER HANDLE"
];

Usage

Public view of the blog will be at /blog

Registered users will be able to access /blog_admin and create/edit/delete new blog posts, categories and tags

Testing

composer test

some test will fail because they require App\User which isn't included.

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 retosteffen@mac.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.