Korzystam z https://github.com/specialtactics/laravel5-api-boilerplate
Wykorzystuje tam Dingoapi i mam problem z update
$user = User::where('email', 'doc@doc.pl')->first(); $user->password = 'secret1234'; $user->save();
Updating the "createdAt" attribute is not allowed.
vendor/specialtactics/l5-api/src/Models/RestfulModel.php ..... // Disallow updating immutable attributes if (! http://www.php.net/empty($model->immutableAttributes)) { // For each immutable attribute, check if they have changed foreach ($model->immutableAttributes as $attributeName) { if ($model->getOriginal($attributeName) != $model->getAttribute($attributeName)) { throw new BadRequestHttpException('Updating the "'.camel_case($attributeName).'" attribute is not allowed.'); } } }
W modelu User ustaw
public $immutableAttributes = [];
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)