This repository was archived by the owner on Dec 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -185,17 +185,36 @@ class UserController extends Controller
185
185
}
186
186
}
187
187
```
188
- #### view
189
- To access service's view file. just prepend service name followed by two colon ::
188
+ #### Views
189
+ To access a service's view file, prepend the file's name with the service name followed by two colons ` :: `
190
190
191
- example
191
+ Example extending view file in blade:
192
192
```
193
- @extends('serivename ::index')
193
+ @extends('servicename ::index')
194
194
```
195
195
196
- with jobs you can specify path like this
196
+ Usage with jobs is similar:
197
+ ``` php
198
+ new RespondWithViewJob('servicename::user.login')
197
199
```
198
- new RespondWithViewJob('servicename::student.login')
200
+
201
+ ` RespondWithJsonJob ` accepts the following parameters:
202
+ ``` php
203
+ RespondWithViewJob($template, $data = [], $status = 200, array $headers = []);
204
+ ```
205
+
206
+ Usage of template with data:
207
+ ``` php
208
+ $this->run(new RespondWithViewJob('servicename::user.list', ['users' => $users]));
209
+ ```
210
+ Or
211
+ ``` php
212
+ $this->run(RespondWithViewJob::class, [
213
+ 'template' => 'servicename::user.list',
214
+ 'data' => [
215
+ 'users' => $users
216
+ ],
217
+ ]);
199
218
```
200
219
201
220
#### Job
You can’t perform that action at this time.
0 commit comments