99use Orchestra \Workbench \Events \InstallEnded ;
1010use Orchestra \Workbench \Workbench ;
1111
12+ use function Illuminate \Filesystem \join_paths ;
13+
1214class InstalledWorkbench
1315{
14- /**
15- * The filesystem instance.
16- *
17- * @var \Illuminate\Filesystem\Filesystem;
18- */
19- public $ files ;
20-
2116 /**
2217 * Construct a new event listener.
2318 */
24- public function __construct (Filesystem $ files )
19+ public function __construct (public Filesystem $ files )
2520 {
26- $ this -> files = $ files ;
21+ //
2722 }
2823
2924 /**
@@ -49,35 +44,35 @@ public function handle(InstallEnded $event)
4944 components: $ event ->components ,
5045 workingPath: $ workingDirectory ,
5146 ))->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 '] )
5449 );
5550
5651 (new GeneratesFile (
5752 filesystem: $ this ->files ,
5853 components: $ event ->components ,
5954 workingPath: $ workingDirectory ,
6055 ))->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 '] )
6358 );
6459
6560 (new GeneratesFile (
6661 filesystem: $ this ->files ,
6762 components: $ event ->components ,
6863 workingPath: $ workingDirectory ,
6964 ))->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 '] )
7267 );
7368
7469 (new GeneratesFile (
7570 filesystem: $ this ->files ,
7671 components: $ event ->components ,
7772 workingPath: $ workingDirectory ,
7873 ))->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 '] )
8176 );
8277
8378 Collection::make ([
0 commit comments