Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
add more views examples
  • Loading branch information
Mulkave committed Apr 15, 2018
1 parent 46776f2 commit aa00134
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,36 @@ class UserController extends Controller
}
}
```
#### view
To access service's view file. just prepend service name followed by two colon ::
#### Views
To access a service's view file, prepend the file's name with the service name followed by two colons `::`

example
Example extending view file in blade:
```
@extends('serivename::index')
@extends('servicename::index')
```

with jobs you can specify path like this
Usage with jobs is similar:
```php
new RespondWithViewJob('servicename::user.login')
```
new RespondWithViewJob('servicename::student.login')

`RespondWithJsonJob` accepts the following parameters:
```php
RespondWithViewJob($template, $data = [], $status = 200, array $headers = []);
```

Usage of template with data:
```php
$this->run(new RespondWithViewJob('servicename::user.list', ['users' => $users]));
```
Or
```php
$this->run(RespondWithViewJob::class, [
'template' => 'servicename::user.list',
'data' => [
'users' => $users
],
]);
```

#### Job
Expand Down

0 comments on commit aa00134

Please sign in to comment.