Skip to content

Commit b69ed2a

Browse files
authored
Merge pull request #8 from jan-tricks/master
Added support for Laravel 12
2 parents 7397440 + 18df9fa commit b69ed2a

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222
],
2323
"require": {
2424
"php": "^8.0|^9.0",
25-
"illuminate/support": "^9.0|^10.0|^11.0",
26-
"laravel/helpers": "^1.1"
25+
"illuminate/support": "^9.0|^10.0|^11.0|^12.0"
2726
},
2827
"require-dev": {
29-
"orchestra/testbench": "^7.0|^8.0|^9.0",
28+
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",
3029
"spatie/laravel-translatable": "^6.3"
3130
},
3231
"autoload": {

src/HasSlug.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Routing\Route;
66
use Illuminate\Routing\UrlGenerator;
77
use Illuminate\Contracts\Routing\UrlRoutable;
8-
use Illuminate\Support\Facades\Route as Router;
8+
use Illuminate\Support\Str;
99

1010
trait HasSlug
1111
{
@@ -62,7 +62,7 @@ public function getUniqueSlug($sluggable, $locale = null)
6262
$sluggable = $this->getTranslation($sluggable, $locale);
6363
}
6464

65-
$slug = str_slug($sluggable);
65+
$slug = Str::slug($sluggable);
6666

6767
$i = 0;
6868
while($this->slugExists($slug, $locale, $i)) {
@@ -180,7 +180,7 @@ public function getRouteKeyName()
180180
* Generate an URI containing the model's slug from
181181
* given route.
182182
*
183-
* @param Illuminate\Routing\Route $route
183+
* @param \Illuminate\Routing\Route $route
184184
* @param null|string $locale
185185
* @param bool $fullUrl
186186
* @return string
@@ -196,7 +196,7 @@ public function getSluggedUrlForRoute(Route $route, $locale = null, $fullUrl = t
196196
* Get a bound route's parameters with the
197197
* model's slug set to the desired locale.
198198
*
199-
* @param Illuminate\Routing\Route $route
199+
* @param \Illuminate\Routing\Route $route
200200
* @param null|string $locale
201201
* @return array
202202
*/

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Whitecube\Sluggable\Tests;
44

5-
use File;
65
use Illuminate\Database\Schema\Blueprint;
76
use Illuminate\Foundation\Application;
7+
use Illuminate\Support\Facades\File;
88
use Orchestra\Testbench\TestCase as Orchestra;
99

1010
abstract class TestCase extends Orchestra

0 commit comments

Comments
 (0)