| @@ 11-32 (lines=22) @@ | ||
| 8 | use Facade\IgnitionContracts\BaseSolution; |
|
| 9 | use Facade\IgnitionContracts\HasSolutionsForThrowable; |
|
| 10 | ||
| 11 | class MissingMixManifestSolutionProvider implements HasSolutionsForThrowable |
|
| 12 | { |
|
| 13 | public function canSolve(Throwable $throwable): bool |
|
| 14 | { |
|
| 15 | if (! $throwable instanceof ViewException) { |
|
| 16 | return false; |
|
| 17 | } |
|
| 18 | ||
| 19 | return Str::startsWith($throwable->getMessage(), 'The Mix manifest does not exist'); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function getSolutions(Throwable $throwable): array |
|
| 23 | { |
|
| 24 | return [ |
|
| 25 | BaseSolution::create('') |
|
| 26 | ->setSolutionDescription('You should regenerate your assets') |
|
| 27 | ->setDocumentationLinks([ |
|
| 28 | 'Running Mix' => 'https://laravel.com/docs/master/mix#running-mix' |
|
| 29 | ]) |
|
| 30 | ]; |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 10-30 (lines=21) @@ | ||
| 7 | use Facade\IgnitionContracts\BaseSolution; |
|
| 8 | use Facade\IgnitionContracts\HasSolutionsForThrowable; |
|
| 9 | ||
| 10 | class RunningLaravelDuskInProductionProvider implements HasSolutionsForThrowable |
|
| 11 | { |
|
| 12 | public function canSolve(Throwable $throwable): bool |
|
| 13 | { |
|
| 14 | if (! $throwable instanceof Exception) { |
|
| 15 | return false; |
|
| 16 | } |
|
| 17 | ||
| 18 | return $throwable->getMessage() === 'It is unsafe to run Dusk in production.'; |
|
| 19 | } |
|
| 20 | ||
| 21 | public function getSolutions(Throwable $throwable): array |
|
| 22 | { |
|
| 23 | return [ |
|
| 24 | BaseSolution::create('Laravel Dusk should not be run in production.') |
|
| 25 | ->setSolutionDescription('Install the dependencies with the `--no-dev` flag.'), |
|
| 26 | BaseSolution::create('Laravel Dusk can be run in other environments.') |
|
| 27 | ->setSolutionDescription('Consider setting the `APP_ENV` to something other than `production` like `local` for example.'), |
|
| 28 | ]; |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||