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 +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ namespace `App\Domains\User\Jobs\GetUsersJob`).
125
125
##### Run The Job
126
126
In ** ListUsersFeature::handle(Request $request)**
127
127
128
- ```
128
+ ``` php
129
129
public function handle(Request $request)
130
130
{
131
131
$users = $this->run(GetUsersJob::class);
@@ -140,14 +140,15 @@ used to respond to a request in JSON format.
140
140
##### Expose The Feature
141
141
To be able to serve that Feature we need to create a route and a controller that does so.
142
142
143
- Create a controller in ` src/Services/Api/Http/Controllers/UserController.php `
143
+ Generate a plain controller with the following command
144
144
145
- ``` php
146
- namespace App\Services\Api\Http\Controllers;
145
+ ```
146
+ lucid make:controller user --plain
147
+ ```
147
148
148
- use App\Foundation\Http\Controller;
149
- use App\Services\Api\Features\ListUsersFeature;
149
+ Add the ` get ` method to it:
150
150
151
+ ``` php
151
152
class UserController extends Controller
152
153
{
153
154
public function get()
@@ -166,6 +167,8 @@ Add the `/users` route within that group.
166
167
Route::get('/users', 'UserController@get');
167
168
```
168
169
170
+ Now if you visit ` /api/users ` you should see the JSON structure.
171
+
169
172
## CLI Reference
170
173
Following are the commands available through the ` Lucid ` CLI.
171
174
You can’t perform that action at this time.
0 commit comments