File tree Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Original file line number Diff line number Diff line change 39
39
use Facade \Ignition \SolutionProviders \MissingAppKeySolutionProvider ;
40
40
use Facade \Ignition \SolutionProviders \MissingColumnSolutionProvider ;
41
41
use Facade \Ignition \SolutionProviders \MissingImportSolutionProvider ;
42
+ use Facade \Ignition \SolutionProviders \MissingLivewireComponentSolutionProvider ;
42
43
use Facade \Ignition \SolutionProviders \MissingMixManifestSolutionProvider ;
43
44
use Facade \Ignition \SolutionProviders \MissingPackageSolutionProvider ;
44
45
use Facade \Ignition \SolutionProviders \RunningLaravelDuskInProductionProvider ;
@@ -373,6 +374,7 @@ protected function getDefaultSolutions(): array
373
374
UnknownValidationSolutionProvider::class,
374
375
UndefinedPropertySolutionProvider::class,
375
376
MissingMixManifestSolutionProvider::class,
377
+ MissingLivewireComponentSolutionProvider::class,
376
378
];
377
379
}
378
380
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Facade \Ignition \SolutionProviders ;
4
+
5
+ use Facade \Ignition \Solutions \LivewireDiscoverSolution ;
6
+ use Facade \IgnitionContracts \HasSolutionsForThrowable ;
7
+ use Illuminate \Database \QueryException ;
8
+ use Livewire \Exceptions \ComponentNotFoundException ;
9
+ use Livewire \LivewireComponentsFinder ;
10
+ use Throwable ;
11
+
12
+ class MissingLivewireComponentSolutionProvider implements HasSolutionsForThrowable
13
+ {
14
+ public function canSolve (Throwable $ throwable ): bool
15
+ {
16
+ if (! class_exists (ComponentNotFoundException::class)) {
17
+ return false ;
18
+ }
19
+ if (! class_exists (LivewireComponentsFinder::class)) {
20
+ return false ;
21
+ }
22
+ if (! $ throwable instanceof ComponentNotFoundException) {
23
+ return false ;
24
+ }
25
+
26
+ return true ;
27
+ }
28
+
29
+ public function getSolutions (Throwable $ throwable ): array
30
+ {
31
+ return [new LivewireDiscoverSolution ('A livewire component was not found ' )];
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Facade \Ignition \Solutions ;
4
+
5
+ use Facade \IgnitionContracts \RunnableSolution ;
6
+ use Livewire \LivewireComponentsFinder ;
7
+
8
+ class LivewireDiscoverSolution implements RunnableSolution
9
+ {
10
+ private $ customTitle ;
11
+
12
+ public function __construct ($ customTitle = '' )
13
+ {
14
+ $ this ->customTitle = $ customTitle ;
15
+ }
16
+
17
+ public function getSolutionTitle (): string
18
+ {
19
+ return $ this ->customTitle ;
20
+ }
21
+
22
+ public function getSolutionDescription (): string
23
+ {
24
+ return 'You might have forgotten to discover your livewire components. You can discover your livewire components using `php artisan livewire:discover`. ' ;
25
+ }
26
+
27
+ public function getDocumentationLinks (): array
28
+ {
29
+ return [
30
+ 'Livewire: Artisan Commands ' => 'https://laravel-livewire.com/docs/2.x/artisan-commands ' ,
31
+ ];
32
+ }
33
+
34
+ public function getRunParameters (): array
35
+ {
36
+ return [];
37
+ }
38
+
39
+ public function getSolutionActionDescription (): string
40
+ {
41
+ return 'Pressing the button below will try to discover your components. ' ;
42
+ }
43
+
44
+ public function getRunButtonText (): string
45
+ {
46
+ return 'Run livewire components discover ' ;
47
+ }
48
+
49
+ public function run (array $ parameters = [])
50
+ {
51
+ app (LivewireComponentsFinder::class)->build ();
52
+ }
53
+ }
You can’t perform that action at this time.
0 commit comments