guillaumeferron/post-content

A post content builder field for Laravel Nova.

1.1.0 2020-10-13 03:15 UTC

This package is auto-updated.

Last update: 2024-10-25 01:49:08 UTC


README

This package adds a custom field to nova resources.

The field is a post content writer and supports images, videos, paragraphs and carousels.

PostContent Demo

Demo Video

How it works

This package adds orderable rows:

Currently this package only supports :

  • Plain text paragraphs.
  • Url-provided images.
  • Url-provided videos (Youtube | Vimeo | Server Storage).
  • Images / Videos carousels.

Installation and usage

You may require this package using composer:

composer require guillaumeferron/post-content

You can directly use the PostContent in the fields() methods by relating it to a longText SQL attribute:

PostContent::make('attribute_name')

Customization

You can customize the field behavior :

withFields
PostContent::make('attribute_name')->withFields([options])

Choose the fields to be added as new rows

withCarouselFields
PostContent::make('attribute_name')->withCarouselFields([options])

Choose the fields to be added as new carousel's slides

withFileManager
PostContent::make('attribute_name')->withFileManager('url')

Specify the file manager url if it exists. Recommendation: Nova FileManager

hideHelpers
PostContent::make('attribute_name')->hideHelpers()

Hide the blue background helpers displayed when a row needs to be filled

Roadmap

  • Make the initial row dynamic depending on what fields are specified or not.
  • Make the paragraphs' text editor WYSIWYG.
  • Add the two columns options to the paragraphs.

License

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