forked from ulties/voyager-cheatsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·203 lines (190 loc) · 7.03 KB
/
index.html
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="assets/css/normalize.css" />
<link rel="stylesheet" href="assets/css/foundation.min.css" />
<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
<link rel="shortcut icon" href="assets/ico/favicon.png">
<link rel="stylesheet" href="assets/css/page.css" />
<meta name="description" content="Laravel Voyager Cheat Sheet , Codes , function , methods of voyager admin panel">
<title>Voyager Cheat Sheet</title>
</head>
<body>
<a href="#top" id="top-button" title="Top"><i class="icon-arrow-up"></i></a>
<div class="fixed">
<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name"><h1><a href="#">Voyager Cheat Sheet <small>v1.0.0</small></a></h1></li>
<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
</ul>
<section class="top-bar-section">
<ul class="right">
<li class="comments-toggle"><a href="#"><i class="icon-comments"></i> Toggle Code Comments</a></li>
<li><a href="http://github.com/ulties/voyager-cheatsheet" target="_blank"><i class="icon-github"></i> Github</a></li>
<li class="has-dropdown">
<a href="#">Documentation</a>
<ul class="dropdown">
<li>
<a href="https://laravelvoyager.com/docs" target="_blank"><i class="icon-file-text"></i> Voyager Docs</a>
</li>
<li>
<a href="https://laravel.com/docs/" target="_blank"><i class="icon-file-text"></i> Laravel Docs</a>
</li>
</ul>
</li>
</ul>
</section>
</nav>
</div>
<a name="top" id="top-anchor"></a>
<div class="row" id="search-box">
<div class="small-10 small-offset-1 large-6 large-offset-3 columns">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" placeholder="Start typing to search..." id="search" name="search" />
</div>
<div class="small-2 columns">
<button class="button postfix" id="search-button"><i class="icon-search"></i></button>
</div>
</div>
<small id="searchHint">hint: keep tapping the search, it scrolls to the result</small>
</div>
</div>
<div class="row full-width">
<div class="large-4 columns code-column">
<h4><a name="artisan" href="#artisan">Artisan</a></h4>
<pre class="prettyprint lang-php">
// Install Voyager
php artisan voyager:install
// Install Voyager with dummy data
php artisan voyager:install --with-dummy
// Make custom HTTP Voyager controllers
php artisan voyager:controllers
// Ensure a user is admin with all permissions
php artisan voyager:admin [email protected]
</pre>
<h4><a name="menu" href="#menu">Menu</a> <a href="https://the-control-group.github.io/voyager/docs/v0.10/#core-concepts-menus" title="Menu @ Voyager Docs"><i class="icon-file-text"></i></a></h4>
<pre class="prettyprint lang-php">
// Display the "main" menu
Menu::display('main');
// Display the "main" menu with the "bootstrap" style
Menu::display('main', 'bootstrap');
// Display the "main" menu with a custom style
Menu::display('main', 'my_custom_menu_view_file');
</pre>
<h4><a name="setting" href="#setting">Built-in Settings</a></h4>
<pre class="prettyprint lang-php">
// Get setting value of "Site's Title"
Voyager::setting('site.title');
// Get setting value of "Site's Title" with a default of "No Name"
Voyager::setting('title', 'No Name');
// Get the setting icon_image(Icon used on the main login page and the top of sidebar)
Voyager::setting('admin.icon_image');
// Get the bg_image setting which is used in the login page of the admin panel
Voyager::setting('admin.bg_image');
// Get the google_analytics_client_id which is used in the dashboard page.
Voyager::setting("google_analytics_client_id");
// Get the setting title which is used in the <title> tag of the admin panel
Voyager::setting('admin.title');
// Get the setting description which is used in the <title> tag of the admin panel
Voyager::setting('admin.description');
// Get the setting admin_loader which is used as a loader throughout the admin panel(Get creative with gifs here)
Voyager::setting('admin_loader');
</pre>
</div>
<div class="large-4 columns code-column">
<h4><a name="permission" href="#permission">Permission</a></h4>
<pre class="prettyprint lang-php">
// Check if user have permission "visit-admin"
if ($user->hasPermission('visit-admin')) {}
// Check if user have permission and throw exception if not
Voyager::can('visit-admin');
// Check if user have permission or fail
Voyager::canOrFail('visit-admin');
// Check if user have permission or abort with status code
Voyager::canOrAbort('visit-admin', 401);
</pre>
<h4><a name="rules" href="#rules">Validation Rules</a> <a href="https://laravel.com/docs/5.4/validation#available-validation-rules" title="Available Validation Rules @ Laravel Docs"><i class="icon-file-text"></i></a></h4>
<pre class="prettyprint lang-php">
accepted
active_url
after:YYYY-MM-DD
before:YYYY-MM-DD
alpha
alpha_dash
alpha_num
array
between:1,10
confirmed
date
date_format:YYYY-MM-DD
different:fieldname
digits:value
digits_between:min,max
boolean
email
exists:table,column
image
in:foo,bar,...
not_in:foo,bar,...
integer
numeric
ip
max:value
min:value
mimes:jpeg,png
regex:[0-9]
required
required_if:field,value
required_with:foo,bar,...
required_with_all:foo,bar,...
required_without:foo,bar,...
required_without_all:foo,bar,...
sometimes|required|field
same:field
size:value
timezone
unique:table,column,except,idColumn
url
</pre>
</div>
<div class="large-4 columnsi code-column">
<h4><a name="bread-types" href="#bread-types">BREAD Types</a> <a href="http://laravel.com/docs/responses#views" title="Views @ Laravel Docs"><i class="icon-file-text"></i></a></h4>
<pre class="prettyprint lang-php">
// A text box where you can type whatever
Text Box
// A multi-line text area (without a text editor)
Text Area
// A multi-line text area (with a text editor)
Rich Textbox
// A input field with hidden input
Password
// A hidden input field
Hidden
// A check box
Check Box
// A radio button
Radio Button
// A select dropdown without multi-selection
Select Dropdown
// A select dropdown with multi-selection
Multiple Select
// A file upload
File
// A file upload that only accept images
Image
// A input field that only accept a date
Date
// A input field that only accept numbers
Number
</pre>
</div>
</div>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/jquery.highlight-4.js"></script>
<script src="assets/js/foundation.min.js"></script>
<script src="assets/js/google-code-prettify/prettify.js"></script>
<script src="assets/js/app.js"></script>
</body>
</html>