Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jan 22, 2025
2 parents 079802d + 6c07cc8 commit ccf8571
Show file tree
Hide file tree
Showing 9 changed files with 205 additions and 179 deletions.
5 changes: 5 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ transform([
line("return redirect()->intended(route('dashboard', absolute: false));", 2) => line('return redirect()->intended($this->redirectToAfterLoggedIn());', 2),
], static fn ($changes) => $files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/src/Http/Controllers/Auth/AuthenticatedSessionController.php"));

transform([
line('function (User $user) use ($request) {', 3) => line('function ($user) use ($request) {', 3),
line('use Workbench\App\Models\User;') => '',
], static fn ($changes) => $files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/src/Http/Controllers/Auth/NewPasswordController.php"));

transform([
line("return redirect(route('dashboard', absolute: false));", 2) => line('return redirect($this->redirectToAfterLoggedIn());', 2),
], static fn ($changes) => $files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/src/Http/Controllers/Auth/RegisteredUserController.php"));
Expand Down
330 changes: 169 additions & 161 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"laravel-vite-plugin": "^1.0",
"postcss": "^8.4.31",
"tailwindcss": "^3.1.0",
"vite": "^5.0"
"vite": "^5.4"
}
}
5 changes: 0 additions & 5 deletions public/build/assets/app-MratX3S_.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/build/assets/app-O62UIZbF.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"isEntry": true
},
"resources/js/app.js": {
"file": "assets/app-MratX3S_.js",
"file": "assets/app-O62UIZbF.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true
Expand Down
4 changes: 3 additions & 1 deletion src/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot(): void
{
$this->loadRoutesFrom((string) realpath(join_paths(__DIR__, '..', 'routes', 'workbench-auth.php')));
$this->booted(function () {
$this->loadRoutesFrom((string) realpath(join_paths(__DIR__, '..', 'routes', 'workbench-auth.php')));
});

$this->loadViewsFrom((string) realpath(join_paths(__DIR__, '..', 'resources', 'views')), '');

Expand Down
27 changes: 18 additions & 9 deletions src/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ class Workbench extends \Orchestra\Testbench\Workbench\Workbench
* Get the path to the application (Laravel) folder.
*
* @no-named-arguments
*
* @param array<int, mixed>|string ...$path
*/
public static function applicationPath(array|string $path = ''): string
{
return base_path(
join_paths(...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path))
);
/** @var array<int, mixed> $path */
$path = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);

return base_path(join_paths(...$path));
}

/**
* Get the path to the Laravel application skeleton.
*
* @no-named-arguments
*
* @param array<int, mixed>|string ...$path
*
* @see \Orchestra\Workbench\Workbench::applicationPath()
*/
public static function laravelPath(array|string $path = ''): string
Expand All @@ -47,12 +52,15 @@ public static function laravelPath(array|string $path = ''): string
* Get the path to the package folder.
*
* @no-named-arguments
*
* @param array<int, mixed>|string ...$path
*/
public static function packagePath(array|string $path = ''): string
{
return package_path(
...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path)
);
/** @var array<int, mixed> $path */
$path = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);

return package_path(...$path);
}

/**
Expand All @@ -62,9 +70,10 @@ public static function packagePath(array|string $path = ''): string
*/
public static function path(array|string $path = ''): string
{
return workbench_path(
...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path)
);
/** @var array<int, mixed> $path */
$path = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);

return workbench_path(...$path);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/WorkbenchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public function register(): void
*/
public function boot(): void
{
$this->loadRoutesFrom((string) realpath(join_paths(__DIR__, '..', 'routes', 'workbench.php')));
$this->booted(function () {
$this->loadRoutesFrom((string) realpath(join_paths(__DIR__, '..', 'routes', 'workbench.php')));
});

$this->app->make(HttpKernel::class)->pushMiddleware(Http\Middleware\CatchDefaultRoute::class);

Expand Down

0 comments on commit ccf8571

Please sign in to comment.