diff --git a/src/HasSlug.php b/src/HasSlug.php index d28f6ff..6436343 100644 --- a/src/HasSlug.php +++ b/src/HasSlug.php @@ -190,7 +190,7 @@ protected function generateSubstring($slugSourceString) return substr($slugSourceString, 0, $this->slugOptions->maximumLength); } - public static function findBySlug(string $slug, array $columns = ['*'], callable $additionalQuery = null) + public static function findBySlug(string $slug, array $columns = ['*'], ?callable $additionalQuery = null) { $modelInstance = new static(); $field = $modelInstance->getSlugOptions()->slugField;