@@ -167,22 +167,76 @@ $ npm run dev
167
167
## Usage
168
168
169
169
``` bash
170
- # start local server from laravel directory
170
+ # start local server
171
171
$ php artisan serve
172
+
173
+ # test
174
+ $ php vendor/bin/phpunit
172
175
```
173
- Open your browser and open adress: "localhost:8000"
174
- Choice "Notes" from top bar menu. Then login with credentials:
175
176
176
-
177
- * Password: password
177
+ Open your browser with address: [ localhost:8000 ] ( localhost:8000 )
178
+ Click "Notes" on topbar menu and log in with credentials:
178
179
179
- This user has roles: 'user' and 'admin'
180
- * Role 'user' is required for notes management.
181
- * Role 'admin' is required for users management.
180
+
181
+ * Password: _ password_
182
182
183
- ``` bash
184
- # testing from laravel directory
185
- $ php
183
+ This user has roles: _ user_ and _ admin_
184
+ * Role _ user_ is required for ** notes** management.
185
+ * Role _ admin_ is required for ** users** management.
186
+
187
+ ---
188
+
189
+ ### How to add a link to the sidebar:
190
+
191
+ > Instructions for CoreUI Free Laravel admin template only. _ Pro and Vue.js versions have separate instructions._
192
+
193
+ #### To add a __ link__ to the sidebar - modify seeds file:
194
+ ` my-project/database/seeds/MenusTableSeeder.php `
195
+
196
+ In ` run() ` function - add ` insertLink() ` :
197
+ ``` php
198
+ $id = $this->insertLink( $rolesString, $visibleName, $href, $iconString);
199
+ ```
200
+ * ` $rolesString ` - a string with list of user roles this menu element will be available, ex. ` "guest,user,admin" `
201
+ * ` $visibleName ` - a string caption visible in sidebar
202
+ * ` $href ` - a href, ex. ` /homepage ` or ` http://example.com `
203
+ * ` $iconString ` - a string containing valid CoreUI Icon name (kebab-case), ex. ` cui-speedometer ` or ` cui-star `
204
+
205
+ To add a __ title__ to the sidebar - use function ` insertTitle() ` :
206
+ ``` php
207
+ $id = $this->insertTitle( $rolesString, $title );
208
+ ```
209
+ * ` $rolesString ` - a string with list of user roles this menu element will be available, ex. ` "guest,user,admin" `
210
+ * ` $title ` - a string caption visible in sidebar
211
+
212
+ To add a __ dropdown__ menu to the sidebar - use function ` beginDropdown() ` :
213
+ ``` php
214
+ $id = $this->beginDropdown( $rolesString, $visibleName, $href, $iconString);
215
+ ```
216
+ * ` $rolesString ` - a string with list of user roles this menu element will be available, ex. ` "guest,user,admin" `
217
+ * ` $visibleName ` - a string caption visible in sidebar
218
+ * ` $href ` - a href, ex. ` /homepage ` or ` http://example.com `
219
+ * ` $iconString ` - a string containing valid CoreUI icon name (kebab-case). For example: ` cui-speedometer ` or ` cui-star `
220
+
221
+ To end dropdown section - use function ` endDropdown() ` .
222
+
223
+ To add __ link__ to __ dropdown__ call function ` insertLink() ` between function calls ` beginDropdown() ` and ` endDropdown() ` .
224
+ Example:
225
+ ``` php
226
+ $id = $this->beginDropdown('guest,user,admin', 'Some dropdown', 'http://example.com', 'cui-puzzle');
227
+ $id = $this->insertLink('guest,user,admin', 'Dropdown name', 'http://example.com');
228
+ $this->endDropdown();
229
+ ```
230
+
231
+ __ IMPORTANT__ - At the end of ` run() ` function, call ` joinAllByTransaction() ` function:
232
+ ``` php
233
+ $this->joinAllByTransaction();
234
+ ```
235
+
236
+ Once done with seeds file edit, __ run__ :
237
+ ``` bash
238
+ $ php artisan migrate:refresh --seed
239
+ # This command also rollbacks database and migrates it again.
186
240
```
187
241
188
242
## Creators
0 commit comments