9
9
use Orchestra \Workbench \Events \InstallEnded ;
10
10
use Orchestra \Workbench \Workbench ;
11
11
12
+ use function Illuminate \Filesystem \join_paths ;
13
+
12
14
class InstalledWorkbench
13
15
{
14
- /**
15
- * The filesystem instance.
16
- *
17
- * @var \Illuminate\Filesystem\Filesystem;
18
- */
19
- public $ files ;
20
-
21
16
/**
22
17
* Construct a new event listener.
23
18
*/
24
- public function __construct (Filesystem $ files )
19
+ public function __construct (public Filesystem $ files )
25
20
{
26
- $ this -> files = $ files ;
21
+ //
27
22
}
28
23
29
24
/**
@@ -49,35 +44,35 @@ public function handle(InstallEnded $event)
49
44
components: $ event ->components ,
50
45
workingPath: $ workingDirectory ,
51
46
))->handle (
52
- $ workingDirectory. DIRECTORY_SEPARATOR . 'base-resource.stub ' ,
53
- Workbench::path ('app/ Nova/ Resource.php ' )
47
+ join_paths ( $ workingDirectory, 'base-resource.stub ' ) ,
48
+ Workbench::path ([ 'app ' , ' Nova ' , ' Resource.php '] )
54
49
);
55
50
56
51
(new GeneratesFile (
57
52
filesystem: $ this ->files ,
58
53
components: $ event ->components ,
59
54
workingPath: $ workingDirectory ,
60
55
))->handle (
61
- $ workingDirectory. DIRECTORY_SEPARATOR . 'UserResource.stub ' ,
62
- Workbench::path ('app/ Nova/ User.php ' )
56
+ join_paths ( $ workingDirectory, 'UserResource.stub ' ) ,
57
+ Workbench::path ([ 'app ' , ' Nova ' , ' User.php '] )
63
58
);
64
59
65
60
(new GeneratesFile (
66
61
filesystem: $ this ->files ,
67
62
components: $ event ->components ,
68
63
workingPath: $ workingDirectory ,
69
64
))->handle (
70
- $ workingDirectory. DIRECTORY_SEPARATOR . 'NovaServiceProvider.stub ' ,
71
- Workbench::path ('app/ Providers/ NovaServiceProvider.php ' )
65
+ join_paths ( $ workingDirectory, 'NovaServiceProvider.stub ' ) ,
66
+ Workbench::path ([ 'app ' , ' Providers ' , ' NovaServiceProvider.php '] )
72
67
);
73
68
74
69
(new GeneratesFile (
75
70
filesystem: $ this ->files ,
76
71
components: $ event ->components ,
77
72
workingPath: $ workingDirectory ,
78
73
))->handle (
79
- $ workingDirectory. DIRECTORY_SEPARATOR . 'DatabaseSeeder.stub ' ,
80
- Workbench::path ('database/ seeders/ DatabaseSeeder.php ' )
74
+ join_paths ( $ workingDirectory, 'DatabaseSeeder.stub ' ) ,
75
+ Workbench::path ([ 'database ' , ' seeders ' , ' DatabaseSeeder.php '] )
81
76
);
82
77
83
78
Collection::make ([
0 commit comments