Created
December 14, 2014 20:32
-
-
Save beeblebrox3/ca5b7e124b8268f1e9cd to your computer and use it in GitHub Desktop.
updateUniques
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function updateUniques(array $rules, Eloquent $model) | |
{ | |
foreach ($rules as $field => $rule) { | |
$rules[$field] = preg_replace( | |
"/unique\:([a-z_]+)/i", 'unique:$1,' . $field . ',' . $model->id, $rule | |
); | |
} | |
return $rules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment