Archived
1
0
Fork 0

app/Models/Character.php: make sure name is lowercase with first letter upper case.

This commit is contained in:
Henrik Hautakoski 2021-07-03 13:24:13 +02:00
parent 06ab6e12c5
commit f2fcae83cc

View file

@ -55,7 +55,7 @@ class Character extends Model
*/
public function setNameAttribute($value)
{
$this->attributes['name'] = Str::ucfirst($value);
$this->attributes['name'] = Str::ucfirst(Str::lower($value));
}
/**
@ -76,7 +76,7 @@ class Character extends Model
public function scopeSlug($q, $name)
{
return $q->where('name', Str::ucfirst($name));
return $q->where('name', Str::ucfirst(Str::lower($name)));
}
public function getSlugAttribute()