Skip to content

Commit

Permalink
Merge branch '8.x' into 9.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 a7de828 + ccf8571 commit 6911fcb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,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
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
3 changes: 1 addition & 2 deletions src/Http/Controllers/Auth/NewPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Illuminate\Validation\Rules;
use Illuminate\View\View;
use Orchestra\Workbench\Http\Controllers\Controller;
use Workbench\App\Models\User;

class NewPasswordController extends Controller
{
Expand Down Expand Up @@ -41,7 +40,7 @@ public function store(Request $request): RedirectResponse
// database. Otherwise we will parse the error and return the response.
$status = Password::reset(
$request->only('email', 'password', 'password_confirmation', 'token'),
function (User $user) use ($request) {
function ($user) use ($request) {
$user->forceFill([
'password' => Hash::make($request->password),
'remember_token' => Str::random(60),
Expand Down
2 changes: 2 additions & 0 deletions src/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public static function applicationPath(array|string $path = ''): string
*
* @no-named-arguments
*
* @param array<int, mixed>|string ...$path
*
* @see \Orchestra\Workbench\Workbench::applicationPath()
*/
public static function laravelPath(array|string $path = ''): string
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 6911fcb

Please sign in to comment.