Download the PHP package te7a-houdini/laravel-trix without Composer

On this page you can find all versions of the php package te7a-houdini/laravel-trix. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-trix

Releases Build Status StyleCI Code Quality License Downloads

Configurable Basecamp Trix Editor delivered to your laravel application

inspired by Rails Action Text

Installation

You can install the package via composer:

Then publish the configurations and migrations:

After the migration has been published then run the migrations to create required tables:

then add @trixassets directive at the head tag of your html

Usage

let's assume we have Post model & want to add trix editor.

Using @trix($model, $field, $config = [])

you can use @trix directive inside any view to render trix editor.

Storing Rich Text Fields

now lets try to store content rich text field when hitting submit button.

first add HasTrixRichText trait to your model

then you can easily store any rich text fields by multiple ways:

Render Trix For Existing Model

there's multiple ways to render trix for already existing model

Render Html For Existing Model

You can render the html content for already existing model

Storing Attachment

when uploading a file to trix editor. an ajax request is sent to store_attachment_action in laravel-trix config file. which uses Laravel Storage and then this action returns url if upload is success according to Basecamp Trix api .

the uploaded file will be stored in trix_attachments table as pending attachment.

once model is saved . all pending attachments will have is_pending column = 0

so in order to make storing attachment very easy make sure to use HasTrixRichText trait in your model.

Changing Storage Disk

you can change attachment storage disk from laravel-trix config file .

or if you want to change the storage disk for specific rich text field you can do that

Deleting Rich Text Field and Attachments

you can remove related rich text fields and attachments on a model deleting:

Configuration Table

if you want to hide buttons or toolbar you can do this. for more configuration refer to the table below.

configuration type values description
hideToolbar Boolean True or False hides the the toolbar
hideTools Array ['text-tools', 'block-tools', 'file-tools', 'history-tools'] hides group of buttons
hideButtonIcons Array ['attach', 'bold', 'italic', 'strike', 'link', 'heading-1', 'quote', 'code', 'bullet-list', 'number-list', 'decrease-nesting-level', 'increase-nesting-level'] hides a single button
disk String 'local' or 's3' or 'any-disk' sets the attachment storage per field
id String 'any-value-you-want' the id of input which renders trix. check this link . current id follows this convention (model lowered class name)-field-modelId like post-content-1 or post-content-new-model
containerElement String valid html tag like span or div default container tag is set to span you can change it as you want

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of laravel-trix with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.0
laravel/framework Version ~5.8.0|~6.0|~7.0|~8.0|~9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package te7a-houdini/laravel-trix contains the following files

Loading the files please wait ....