ozdemirburak / laravel-9-simple-cms

Laravel 9 content management system for starters.
MIT License
686 stars 302 forks source link

Collisions with other trait methods on App\Base\SluggableModel #108

Closed safarovitch closed 3 years ago

safarovitch commented 3 years ago

This is an error I get when initializing the package with php artisan cms:initialize --seed

`PHP Fatal error: Trait method customizeSlugEngine has not been applied, because there are collisions with other trait methods on App\Base\SluggableModel in laravel-8-simple-cms\app\Base\SluggableModel.php on line 17

Symfony\Component\ErrorHandler\Error\FatalError

Trait method customizeSlugEngine has not been applied, because there are collisions with other trait methods on App\Base\SluggableModel

at laravel-8-simple-cms\app\Base\SluggableModel.php:17 13▕ @method static \Illuminate\Database\Eloquent\Builder|\App\Base\SluggableModel findSimilarSlugs($attribute, $config, $slug) 14▕ @method static \Illuminate\Database\Eloquent\Builder|\App\Base\SluggableModel whereSlug($slug) 15▕ @mixin \Eloquent 16▕ / ➜ 17▕ class SluggableModel extends Model 18▕ { 19▕ use Sluggable, SluggableEngine, SluggableScopeHelpers; 20▕ 21▕ /**

Whoops\Exception\ErrorException

Trait method customizeSlugEngine has not been applied, because there are collisions with other trait methods on App\Base\SluggableModel

at laravel-8-simple-cms\app\Base\SluggableModel.php:17 13▕ @method static \Illuminate\Database\Eloquent\Builder|\App\Base\SluggableModel findSimilarSlugs($attribute, $config, $slug) 14▕ @method static \Illuminate\Database\Eloquent\Builder|\App\Base\SluggableModel whereSlug($slug) 15▕ @mixin \Eloquent 16▕ / ➜ 17▕ class SluggableModel extends Model 18▕ { 19▕ use Sluggable, SluggableEngine, SluggableScopeHelpers; 20▕ 21▕ /**

1 laravel-8-simple-cms\vendor\filp\whoops\src\Whoops\Run.php:454 Whoops\Run::handleError("Trait method customizeSlugEngine has not been applied, because there are collisions with other trait methods on App\Base\SluggableModel", "laravel-8-simple-cms\app\Base\SluggableModel.php")

2 [internal]:0 Whoops\Run::handleShutdown()`

claudesimo1990 commented 3 years ago

Remove use Sluggable, SluggableEngine, SluggableScopeHelpers; and replace it with use Sluggable, SluggableScopeHelpers;

this can resolve the Bug :)

ozdemirburak commented 3 years ago

@safarovitch Thanks for reporting this. And, @claudesimo1990 thanks for your reply. Fixed it.