Skip to content

Releases: tonysm/rich-text-laravel

3.2.1

31 Oct 15:30
27792ad
Compare
Choose a tag to compare

What's Changed

  • feat: add safety migration rollback on rich_texts table by @kresnasatya in #60

New Contributors

Full Changelog: 3.2.0...3.2.1

3.2.0

14 Oct 22:58
3cd2b3d
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.1.0...3.2.0

3.1.0

14 Apr 21:21
bc9b0b4
Compare
Choose a tag to compare

What's Changed

  • Support custom content attachments that don't require SGIDs by @tonysm in #56

Full Changelog: 3.0.0...3.1.0

3.0.0

16 Mar 19:36
960e096
Compare
Choose a tag to compare

What's Changed

  • Default to encryptString and decryptString by @tonysm in #53

Full Changelog: 2.2.0...3.0.0


Upgrade Guide

In 2.2.0 we introduced a new recommended way to encrypt data, which uses Laravel's Crypt::encryptString() instead of Crypt::encrypt(). This is now the default in v3. If you're migrating from 2.x and have existing data stored encrypted, but not using the recommendation in the 2.2.0 release note, you must migrate them (see instructions below).

Migrating Existing Encrypted Data

If you only have encrypted rich text attributes in your application, you may create a new migration and loop through the stored data, encrypting and decrypting it:

DB::table('rich_texts')->whereNotNull('body')->eachById(function ($richText) {
  DB::table('rich_texts')
    ->where('id', $richText->id)
    ->update([
      'body' => Crypt::encryptString(Crypt::decrypt($richText->body)),
    ]);
});

If you have a mix of encrypted and plain text rich text attributes, you will have to check if the $richText->field and $richText->record_type fields match the entities and attribute that are using encryption:

DB::table('rich_texts')
  ->whereNotNull('body')
  ->where('field', 'content')
  ->where('record_type', (new Post())->getMorphClass())
  ->eachById(function ($richText) {
    DB::table('rich_texts')
      ->where('id', $richText->id)
      ->update([
        'body' => Crypt::encryptString(Crypt::decrypt($richText->body)),
      ]);
  });

2.2.0

16 Mar 19:12
15a0e37
Compare
Choose a tag to compare

What's Changed

  • Allow configuring the encryption handlers by @tonysm in #52

Full Changelog: 2.1.0...2.2.0


Upgrade Guide

It's now recommended that you add a RichTextLaravel::encryptAsString() to your AppServiceProvider::boot method. If you have existing data stored encrypted, you'll have to migrate them manually (see instructions below). This is an opt-in feature, but it's highly recommended to store encrypted rich text attributes as string (the default way will serialize the value before encrypting, which is not needed).

In the next major version, we'll switch to encrypt as string by default.

Migrating Existing Encrypted Data

If you only have encrypted rich text attributes in your application, you may create a new migration and loop through the stored data, encrypting and decrypting it:

DB::table('rich_texts')->whereNotNull('body')->eachById(function ($richText) {
  DB::table('rich_texts')
    ->where('id', $richText->id)
    ->update([
      'body' => Crypt::encryptString(Crypt::decrypt($richText->body)),
    ]);
});

Make sure you add the RichTextLaravel::encryptAsString() to your AppServiceProvider::boot method.

If you have a mix of encrypted and plain text rich text attributes, you will have to check if the $richText->field and $richText->record_type fields match the entities and attribute that are using encryption:

DB::table('rich_texts')
  ->whereNotNull('body')
  ->where('field', 'content')
  ->where('record_type', (new Post())->getMorphClass())
  ->eachById(function ($richText) {
    DB::table('rich_texts')
      ->where('id', $richText->id)
      ->update([
        'body' => Crypt::encryptString(Crypt::decrypt($richText->body)),
      ]);
  });

2.1.0

08 Mar 02:51
9a89b33
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.0.3...2.1.0

2.0.3

03 Mar 22:20
cd77595
Compare
Choose a tag to compare

What's Changed

  • Fix should not touch records timestamp when touching is disabled by @tonysm in #49

Full Changelog: 2.0.2...2.0.3

2.0.2

02 Mar 00:29
3782fbd
Compare
Choose a tag to compare

What's Changed

  • Fix install command to import Trix JS module and stop publishing the CSS file in favor of the styles component by @tonysm in #45

Full Changelog: 2.0.1...2.0.2

2.0.1

22 Feb 02:59
557c89e
Compare
Choose a tag to compare

Changelog

  • FIXED: Fixed the importmap command when installing in a project during Importmap Laravel

2.0.0

21 Feb 03:06
ac797e2
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.7.0...2.0.0


Upgrade Guide

A few things changed from v1. There are some breaking changes, but most are renamings.

Rename the Rich Text Property

Rename all your $richTextFields properties to $richTextAttributes on all your models using it

Rename the Styles Component

Rename the <x-rich-text-trix-styles /> to <x-rich-text::styles />

Rename the Published Trix Input Component

Rename the <x-trix-field /> to <x-trix-input /> (both the file and its usages)