app/Models/Character.php: make sure name is lowercase with first letter upper case.
This commit is contained in:
parent
06ab6e12c5
commit
f2fcae83cc
1 changed files with 2 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Reference in a new issue