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

Commit 3cf2d99

Browse files
committed
update readme
1 parent 7c8227f commit 3cf2d99

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

readme.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ namespace `App\Domains\User\Jobs\GetUsersJob`).
125125
##### Run The Job
126126
In **ListUsersFeature::handle(Request $request)**
127127

128-
```
128+
```php
129129
public function handle(Request $request)
130130
{
131131
$users = $this->run(GetUsersJob::class);
@@ -140,14 +140,15 @@ used to respond to a request in JSON format.
140140
##### Expose The Feature
141141
To be able to serve that Feature we need to create a route and a controller that does so.
142142

143-
Create a controller in `src/Services/Api/Http/Controllers/UserController.php`
143+
Generate a plain controller with the following command
144144

145-
```php
146-
namespace App\Services\Api\Http\Controllers;
145+
```
146+
lucid make:controller user --plain
147+
```
147148

148-
use App\Foundation\Http\Controller;
149-
use App\Services\Api\Features\ListUsersFeature;
149+
Add the `get` method to it:
150150

151+
```php
151152
class UserController extends Controller
152153
{
153154
public function get()
@@ -166,6 +167,8 @@ Add the `/users` route within that group.
166167
Route::get('/users', 'UserController@get');
167168
```
168169

170+
Now if you visit `/api/users` you should see the JSON structure.
171+
169172
## CLI Reference
170173
Following are the commands available through the `Lucid` CLI.
171174

0 commit comments

Comments
 (0)