After the same problem, I did something, and found a way to install something other than home, I changed a few things, but hopefully this works for you too!
TL; DR
Spark::afterLoginRedirectTo('somenewplace');
Option 1
Variable used: $afterLoginRedirectTofrom provider \ laravel \ spark \ src \ Configuration \ ManagesAppOptions.php
You can set this in the SparkServiceProvider @ boot method:
Spark::afterLoginRedirectTo('somenewplace');
Spark LoginController\vendor\laravel\spark\src\Http\Controllers\Auth\LoginController.php
:
if (Spark::usesTwoFactorAuth() && $user->uses_two_factor_auth) {
return $this->redirectForTwoFactorAuth($request, $user);
}
return redirect()->intended($this->redirectPath());
RedirectPath() - RedirectsUsers, :
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
redirectTo LoginController :
$this->redirectTo = Spark::afterLoginRedirect();
2
, .
web.php :
Route::post('/login', 'Auth\NewLoginController@login');
LoginController :
class LoginController extends \Laravel\Spark\Http\Controllers\Auth\LoginController
{
public function authenticated(Request $request, $user)
{
if ($user->last_page_accessed != null) {
$this->redirectTo = $user->last_page_accessed;
}
return parent::authenticated($request, $user);
}
}