Skip to content

Commit b891ddf

Browse files
committed
Implement authorizations on Editor builder.
(cherry picked from commit dd0312c64912c013cd6f175c77d9c2caa9810a2c)
1 parent 9a96488 commit b891ddf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Html/Editor/Editor.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
use Illuminate\Support\Arr;
66
use Illuminate\Support\Str;
77
use Illuminate\Support\Fluent;
8+
use Yajra\DataTables\Html\HasAuthorizations;
89
use Yajra\DataTables\Utilities\Helper;
910
use Yajra\DataTables\Html\Editor\Fields\Field;
1011

1112
class Editor extends Fluent
1213
{
1314
use HasEvents;
15+
use HasAuthorizations;
16+
1417
const DISPLAY_LIGHTBOX = 'lightbox';
1518
const DISPLAY_ENVELOPE = 'envelope';
1619
const DISPLAY_BOOTSTRAP = 'bootstrap';
@@ -20,7 +23,7 @@ class Editor extends Fluent
2023
/**
2124
* Editor constructor.
2225
*
23-
* @param string $instance
26+
* @param string|array $instance
2427
*/
2528
public function __construct($instance = 'editor')
2629
{
@@ -37,6 +40,10 @@ public function __construct($instance = 'editor')
3740
*/
3841
public static function make($instance = 'editor')
3942
{
43+
if (is_array($instance)) {
44+
$instance = $instance['editor'] ?? 'editor';
45+
}
46+
4047
return new static($instance);
4148
}
4249

0 commit comments

Comments
 (0)