File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change 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 >
120120## API Detail:
121121
122122
123- Soon
124-
125123### Add Exception
126124Add 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
158178Soon
You can’t perform that action at this time.
0 commit comments