22
33use Exception ;
44use Illuminate \Database \Eloquent \Model ;
5- use Illuminate \Http \Request ;
65use Jarischaefer \HalApi \Exceptions \BadPostRequestException ;
76use Jarischaefer \HalApi \Exceptions \BadPutRequestException ;
87use Jarischaefer \HalApi \Exceptions \DatabaseConflictException ;
98use Jarischaefer \HalApi \Exceptions \DatabaseSaveException ;
10- use Jarischaefer \HalApi \Transformers \HalApiTransformer ;
9+ use Jarischaefer \HalApi \Transformers \HalApiTransformerContract ;
1110use Symfony \Component \HttpFoundation \Response ;
1211
1312/**
@@ -39,11 +38,12 @@ public static function getModel();
3938 * exception.
4039 *
4140 * If you do not typehint your method (take a look at the update method in this class), the variable passed
42- * will be null. Otherwise an instance of your model with the ->exists property set to false is passed.
41+ * will be the original route parameter.
42+ * Otherwise, an instance of your model with the ->exists property set to false is passed.
4343 *
44- * public function update($user = null )
44+ * public function update($user)
4545 * {
46- * var_dump($user) // null if not found in database
46+ * var_dump($user) // original route parameter (e.g. new resource's ID) if not found in database
4747 * }
4848 *
4949 * public function update(User $user)
@@ -61,7 +61,7 @@ public static function getModelBindingCallback();
6161 /**
6262 * Returns an instance of a transformer to be used for all transformations in this controller.
6363 *
64- * @return HalApiTransformer
64+ * @return HalApiTransformerContract
6565 */
6666 public function getTransformer ();
6767
0 commit comments