Download the PHP package dive-be/nova-froala-field without Composer
On this page you can find all versions of the php package dive-be/nova-froala-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-froala-field
Froala WYSIWYG Editor field for Laravel Nova
Introduction
This is a fork of the original froala/nova-froala-field
repository.
This minimalistic version will be maintained indefinitely until all of our projects are migrated off Froala.
Installation
You can install the package into a Laravel application that uses Nova via composer:
Usage
Just use the Froala\Nova\Froala
field in your Nova resource:
Override Config Values
To change any of config values for froala field, publish a config file:
Customize Editor Options
For changing any Available Froala Option
edit froala.options
value:
If you want to set options only to specific field, just pass them to options
method:
Attachments
Note If you are not going to use Froala's attachment functionality, you should call the
Froala::ignoreMigrations
method in the register method of your application'sApp\Providers\AppServiceProvider
class.
Nova Froala Field provides native attachments driver which works similar to Trix File Uploads, but with ability to optimize images.
Run migrations:
Attachments Usage
To allow users to upload images, files and videos, just like with Trix field, chain the withFiles
method onto the field's definition. When calling the withFiles
method, you should pass the name of the filesystem disk that photos should be stored on:
And also, in your app/Console/Kernel.php
file, you should register a daily job to prune any stale attachments from the pending attachments table and storage:
Images Optimization
Note Don't forget to check out spatie/image-optimizer's documentation e.g. to install the required binaries on your machine.
All uploaded images will be optimized by default by spatie/image-optimizer. You can disable image optimization in config file (not recommended):
Upload Max Filesize
You can set max upload filesize for attachments. If set to null
, max upload filesize equals to php.ini upload_max_filesize
directive value.
Display Edited Content
According to Froala Display Edited Content documentation you should publish Froala styles:
include into view where an edited content is shown:
Also, you should make sure that you put the edited content inside an element that has the .fr-view
class:
Show on Index Page
You have an ability to show field content on resource index page in popup window:
Just click Show Content
License Key
To setup your license key, set FROALA_KEY
environment variable:
Advanced
Custom Event Handlers
If you want to setup custom event handlers for froala editor instance, create js file and assign events
property to window.froala
:
to all callbacks provided in window.froala.events
, the context of VueJS form field component is automatically applied, you can work with this
inside callbacks like with Vue instance component.
After that, load the js file into Nova scripts in NovaServiceProvider::boot
method:
Customize Attachment Handlers
You can change any of attachment handlers by passing a callable
:
Development
You may get started with this package as follows (after cloning the repository):
Fixing code-style
PHP
JS
Testing
Building dev assets
Building production assets
Contributing
To contribute, simply make a pull request to this repository with your changes. Make sure they are documented well in your pull request description.
Credits
- Muhammed Sarı
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of nova-froala-field with dependencies
laravel/nova Version ^4.12
league/flysystem Version ^3.0
nova-kit/nova-packages-tool Version ^1.11
spatie/image-optimizer Version ^1.7