cirruslab/laravel-content-area

Adds an editable content area to Laravel.

1.0.0 2016-11-15 16:34 UTC

This package is not auto-updated.

Last update: 2024-11-23 21:38:29 UTC


README

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