cirruslab / laravel-content-area by cirruslab

Adds an editable content area to Laravel.
18
1
3
Package Data
Maintainer Username: cirruslab
Maintainer Contact: george@cirruslab.com (George Fehr)
Package Create Date: 2016-11-15
Package Last Update: 2016-11-15
Home Page:
Language: HTML
License: MIT
Last Refreshed: 2024-11-19 03:05:40
Package Statistics
Total Downloads: 18
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 1
Total Open Issues: 0

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