Skip to content

Commit d5cbb93

Browse files
authored
fix: Allows configurable workbench namespace (#3)
* fix: Allows configurable workbench namespace. Signed-off-by: Mior Muhammad Zaki <[email protected]> * chore: bump deps Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent aebd66e commit d5cbb93

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"php": "^8.1",
99
"composer-runtime-api": "^2.2",
1010
"fakerphp/faker": "^1.24",
11-
"orchestra/workbench": "^8.12|^9.8",
11+
"orchestra/workbench": "^8.13|^9.9",
1212
"symfony/polyfill-php83": "^1.31"
1313
},
1414
"require-dev": {

src/DevTool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class DevTool extends Nova
1717
*/
1818
public static function resourcesIn(string $directory): void
1919
{
20-
$namespace = 'Workbench\App\\';
20+
$namespace = Workbench::detectNamespace('app');
2121

2222
$resources = [];
2323

src/DevToolServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Orchestra\Workbench\Events\InstallEnded;
1515
use Orchestra\Workbench\Events\InstallStarted;
1616
use Orchestra\Workbench\Workbench;
17+
1718
use function Illuminate\Filesystem\join_paths;
1819

1920
class DevToolServiceProvider extends ServiceProvider

tests/Feature/Console/PolicyMakeCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
], 'app/Nova/Policies/UserPolicy.php');
5858
});
5959

60-
6160
it('can generate policy file for a resource', function () {
6261
artisan('nova:policy', ['name' => 'PostPolicy', '--resource' => 'Post', '--preset' => 'laravel'])
6362
->assertSuccessful();

tests/Feature/Listeners/InstallingWorkbenchTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
use Illuminate\Contracts\Console\Kernel as ConsoleKernel;
43
use Illuminate\Console\View\Components\Factory as ViewComponent;
4+
use Illuminate\Contracts\Console\Kernel as ConsoleKernel;
55
use Illuminate\Filesystem\Filesystem;
66
use Laravel\Nova\DevTool\Listeners\InstallingWorkbench;
77
use Mockery as m;
@@ -12,7 +12,7 @@
1212
it('can make user model and factory if installation without `--basic` option', function () {
1313
$kernel = m::mock(ConsoleKernel::class);
1414

15-
$listener = new InstallingWorkbench($kernel, new Filesystem());
15+
$listener = new InstallingWorkbench($kernel, new Filesystem);
1616

1717
$event = new InstallStarted(
1818
$input = m::mock(InputInterface::class),
@@ -32,7 +32,7 @@
3232
it('can throw exception if installation with `--basic` option', function () {
3333
$kernel = m::mock(ConsoleKernel::class);
3434

35-
$listener = new InstallingWorkbench($kernel, new Filesystem());
35+
$listener = new InstallingWorkbench($kernel, new Filesystem);
3636

3737
$event = new InstallStarted(
3838
$input = m::mock(InputInterface::class),

0 commit comments

Comments
 (0)