Skip to content

Commit f063935

Browse files
committed
use static make for same message everywhere
1 parent 9edb6b8 commit f063935

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Translatable/Exception/LocalesNotDefinedException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44

55
class LocalesNotDefinedException extends \Exception
66
{
7+
public static function make(): self
8+
{
9+
return new static('Please make sure you have run `php artisan vendor:publish --provider="Astrotomic\Translatable\TranslatableServiceProvider"` and that the locales configuration is defined.');
10+
}
711
}

src/Translatable/Locales.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function load(): void
8888
$localesConfig = (array) $this->config->get('translatable.locales', []);
8989

9090
if (empty($localesConfig)) {
91-
throw new LocalesNotDefinedException('Please make sure you have run `php artisan vendor:publish --provider="Astrotomic\Translatable\TranslatableServiceProvider"` and that the locales configuration is defined.');
91+
throw LocalesNotDefinedException::make();
9292
}
9393

9494
$this->locales = [];

0 commit comments

Comments
 (0)