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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user