Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Database/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class Model extends EloquentModel
*/
public $duplicateCache = true;

/**
* @var bool Indicates if all string model attributes will be trimmed prior to saving.
*/
public $trimStringAttributes = true;

/**
* @var array The array of models booted events.
*/
Expand Down Expand Up @@ -1239,7 +1244,7 @@ public function setAttribute($key, $value)
/*
* Trim strings
*/
if (is_string($value)) {
if ($this->trimStringAttributes && is_string($value)) {
$value = trim($value);
}

Expand Down