Skip to content

Commit

Permalink
Added makeHidden method
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreuer95 committed Aug 5, 2016
1 parent 01cf96f commit c94ceec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,23 @@ public function makeVisible($attributes)
return $this;
}

/**
* Make the given, typically visible, attributes hidden.
*
* @param array|string $attributes
* @return $this
*/
public function makeHidden($attributes)
{
$this->visible = array_diff($this->visible, (array) $attributes);

if (! empty($this->hidden)) {
$this->addHidden($attributes);
}

return $this;
}

/**
* Make the given, typically hidden, attributes visible.
*
Expand Down

0 comments on commit c94ceec

Please sign in to comment.