-
-
Notifications
You must be signed in to change notification settings - Fork 669
Expand file tree
/
Copy pathExampleTextEditorsScreen.php
More file actions
84 lines (72 loc) · 1.9 KB
/
ExampleTextEditorsScreen.php
File metadata and controls
84 lines (72 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
namespace App\Orchid\Screens\Examples;
use App\Orchid\Layouts\Examples\ExampleElements;
use Illuminate\Support\Str;
use Orchid\Screen\Action;
use Orchid\Screen\Fields\Code;
use Orchid\Screen\Fields\Quill;
use Orchid\Screen\Fields\SimpleMDE;
use Orchid\Screen\Screen;
use Orchid\Support\Facades\Layout;
class ExampleTextEditorsScreen extends Screen
{
/**
* Fetch data to be displayed on the screen.
*
* @return array
*/
public function query(): iterable
{
return [
'quill' => 'Hello! We collected all the fields in one place',
'simplemde' => '# Big header',
'code' => Str::limit(file_get_contents(__FILE__), 500),
];
}
/**
* The name of the screen displayed in the header.
*/
public function name(): ?string
{
return 'Form Text Editors';
}
/**
* Display header description.
*/
public function description(): ?string
{
return 'Examples for creating a wide variety of forms.';
}
/**
* The screen's action buttons.
*
* @return Action[]
*/
public function commandBar(): iterable
{
return [];
}
/**
* The screen's layout elements.
*
* @throws \Throwable
*
* @return \Orchid\Screen\Layout[]
*/
public function layout(): iterable
{
return [
ExampleElements::class,
Layout::rows([
SimpleMDE::make('simplemde')
->title('SimpleMDE')
->popover('SimpleMDE is a simple, embeddable, and beautiful JS markdown editor'),
Quill::make('quill')
->title('Quill')
->popover('Quill is a free, open source WYSIWYG editor built for the modern web.'),
Code::make('code')
->title('Code'),
]),
];
}
}