Commit a612b2bb authored by Antoine Le Gonidec's avatar Antoine Le Gonidec

Drop deprecated str_slug global function, use Illuminate\Support\Str::slug instead

parent c654e762
......@@ -2,6 +2,8 @@
namespace App;
use Illuminate\Support\Str;
class Game extends Model {
private static $images_table = 'games_images';
......@@ -103,7 +105,7 @@ class Game extends Model {
* @return void
*/
public function setGameNameAttribute(string $name) {
$slug = str_slug($name);
$slug = Str::slug($name);
$this->attributes['game_name'] = $name;
$this->attributes['game_name_slug'] = $slug;
}
......@@ -154,7 +156,7 @@ class Game extends Model {
}
$answer = [];
if ( ! empty($search) ) {
$search_slug = str_slug($search);
$search_slug = Str::slug($search);
$search_patterns = explode('-', $search_slug);
$query = self::where(function ($query) use ($search_patterns) {
foreach ( $search_patterns as $pattern ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment