File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,26 @@ class LaravelErrorShareServiceProvider extends PackageServiceProvider
10
10
{
11
11
public function registeringPackage (): void
12
12
{
13
- View::prependNamespace ('laravel-exceptions-renderer ' , [__DIR__ .'/../resources/views ' ]);
13
+ if ($ this ->canIncludeViews ()) {
14
+ View::prependNamespace ('laravel-exceptions-renderer ' , [__DIR__ .'/../resources/views ' ]);
15
+ }
14
16
}
15
17
16
18
public function configurePackage (Package $ package ): void
17
19
{
18
20
$ package
19
21
->name ('laravel-error-share ' )
20
- ->hasConfigFile ()
21
- ->hasViews ();
22
+ ->hasConfigFile ();
23
+
24
+
25
+ if ($ this ->canIncludeViews ()) {
26
+ $ package ->hasViews ();
27
+ }
28
+ }
29
+
30
+ protected function canIncludeViews (): bool
31
+ {
32
+ // Otherwise php artisan optimize may crash
33
+ return config ('app.debug ' ) === true ;
22
34
}
23
35
}
You can’t perform that action at this time.
0 commit comments