Skip to content

Commit

Permalink
fixing issue: #2 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-roth authored Oct 10, 2024
1 parent 7c9460c commit 47b0680
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/SunEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ class SunEditor extends Field implements DeletableContract, FilterableField, Sto
*/
public $showOnIndex = false;

/**
* Construct a new field.
* @param $name
* @param $attribute
* @param callable|null $resolveCallback
*/
public function __construct( $name, $attribute = null, callable $resolveCallback = null ) {
parent::__construct($name, $attribute, $resolveCallback);

// Add X-CSRF-TOKEN to the header of the image upload request
$this->settings([
'imageUploadHeader' => [
'X-CSRF-TOKEN' => csrf_token(),
]
]);
}

/**
* Make the field filter.
*
Expand Down

0 comments on commit 47b0680

Please sign in to comment.