cirruslab/laravel-content-area

Adds an editable content area to Laravel.
19 1
Install
composer require cirruslab/laravel-content-area
Latest Version:1.0.0
License:MIT
Last Updated:Nov 15, 2016
Links: GitHub  ·  Packagist
Maintainer: cirruslab

Editable Content Area for Laravel

Adds an editable content area directive to the Laravel Blade templating engine.

Installation

Require the package in your composer.json file

{
    "require": {
        "cirruslab/laravel-content-area": "dev-master"
    },
}

Then run composer update from your command line

Add the following to the list of service providers in app/config/app.php

Cirruslab\LaravelContentArea\ContentAreaServiceProvider::class

Run the publish command which will publish the config file and assets.

php artisan vendor:publish --tag=contentarea

And migrate the database.

php artisan migrate

Setup permissions for who has permissions to edit the content areas in app/config/contentarea.php and adding a list of email addresses to the $editors array. Alternatively you can modify the can_edit function to integrate with your existing user authorization system.

Usage

Include the CKEditor javascript file in the head of your application layout file.

    <script src="/js/ckeditor/ckeditor.js"></script>

Now you can simply use the @content_area('area_name') tag in your Blade template file. Note that the 'area_name' needs to be unique for each separate area, but you can add as many areas on a page as you want.

Note: If you change an area name, you will need to remove the cached Blade views in order for the changes to show up. You can do this by running the following command.

php artisan view:clear

Related Packages

philo/laravel-blade

Use the simple and yet powerful Laravel Blade templating engine as a standalone...

683,521 355
fitztrev/laravel-html-minify

Minifies the HTML output of Laravel 4 applications

214,922 415
igaster/laravel-theme

Laravel Themes: Asset & Views folder per theme. Theme inheritance. Blade integra...

1,260,414 515
spatie/laravel-blade-javascript

A Blade directive to export variables to JavaScript

932,995 620
riverskies/laravel-mobile-detect

Instant mobile detection access directly from within Blade templates.

1,539,552 231