Skip to content
Permalink
Browse files

Disable mass assignment protection when using findOrCreate().

We'll assume that the find parameters are intended to bypass
mass-assignment restrictions and always be assigned.
  • Loading branch information...
markstory committed Sep 23, 2014
1 parent 6b39c84 commit 85e26fe8b5c71999649879a640181111abc645de
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/ORM/Table.php
@@ -954,7 +954,8 @@ public function findOrCreate($search, callable $callback = null) {
if ($row) {
return $row;
}
$entity = $this->newEntity($search);
$entity = $this->newEntity();
$entity->set($search, ['guard' => false]);
if ($callback) {
$callback($entity);
}

0 comments on commit 85e26fe

Please sign in to comment.
You can’t perform that action at this time.