Remove remaining DB::Raw(concat) calls to make things more sqlite friendly. This adds one new method to the Asset Model to return the formatted string that was used by the license and asset maintence controller. It also fixes a potential sqlite-only issue where '' and null are different.

This commit is contained in:
Daniel Meltzer
2016-05-24 20:05:48 -05:00
parent 45d93ffa8c
commit 0fa82743a1
4 changed files with 20 additions and 97 deletions
+9
View File
@@ -172,6 +172,15 @@ class Asset extends Depreciable
}
public function getDetailedNameAttribute() {
$user = $this->assigneduser;
if($user) {
$user_name = $user->fullName();
} else {
$user_name = "Unassigned";
}
return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . $this->model->name;
}
public function validationRules($id = '0')
{
return $this->rules;