Skip to content

Commit 5bad5d4

Browse files
author
Mark
committed
no message
1 parent 4fbc810 commit 5bad5d4

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<a name="step1"></a>
3939
### Step 1: Get the code
4040

41-
`https://github.com/devmark/laravel-angular-cms/archive/master.zip`
41+
[Download Now](https://github.com/devmark/laravel-angular-cms/archive/master.zip)
4242

4343
-----
4444
<a name="step2"></a>
@@ -120,8 +120,6 @@ Soon
120120
## API Detail:
121121

122122

123-
Soon
124-
125123
### Add Exception
126124
Add Whatever Exception you want in `api/app/Exceptions`
127125

@@ -152,7 +150,29 @@ Output:
152150
```
153151

154152
### Add Transformer
155-
Soon
153+
It helps to output good format you need.
154+
Add new transformer you want in `api/app/Transformers`
155+
More details: see [this](http://fractal.thephpleague.com/transformers/)
156+
157+
```php
158+
class UserTransformer extends TransformerAbstract
159+
{
160+
161+
public function transform(User $item)
162+
{
163+
return [
164+
'id' => (int)$item->id,
165+
'email' => $item->email,
166+
'lastname' => $item->lastname,
167+
'firstname' => $item->firstname,
168+
'phone' => $item->phone,
169+
'active' => (boolean)$item->active,
170+
'created_at' => $item->created_at,
171+
'updated_at' => $item->updated_at,
172+
];
173+
}
174+
}
175+
```
156176

157177
### Config JWT
158178
Soon

0 commit comments

Comments
 (0)