Skip to content

Commit 6621fcd

Browse files
authored
Update str_slug to Str::slug
str_slug was remove in Laravel 6
1 parent 448e77d commit 6621fcd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/RouteToClass.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Zschuessler\RouteToClass;
44

5+
use Illuminate\Support\Str;
6+
57
/**
68
* Class RouteToClass
79
*
@@ -125,15 +127,15 @@ public function addClass($value, $sanitizeClassString = true)
125127
/**
126128
* Sanitize CSS Class String
127129
*
128-
* Currently a simple wrapper around the `str_slug` method in Laravel.
130+
* Currently a simple wrapper around the `Str::slug` method in Laravel.
129131
*
130132
* @param $value string The class name to sanitize.
131133
*
132134
* @return string A sanitized class name (a valid css class, eg no special characters).
133135
*/
134136
public function sanitizeClassString($value)
135137
{
136-
return str_slug($value);
138+
return Str::slug($value);
137139
}
138140

139141
/**
@@ -177,4 +179,4 @@ public function generateClassString()
177179

178180
return $classString;
179181
}
180-
}
182+
}

0 commit comments

Comments
 (0)