thesimons started a new conversation+100 XP
5mos ago
Hello,
I'm dev mode locally using Herd Pro. I'm working with a pretty heavy panel powered by Filament 4.
I have tweaked the tweak-able things. I have max exec time at 300 seconds. But it keeps going timeout.
Any idea how to avoid it? I have hard this issue before but the solution was for Windows.
Thanks, Simom
thesimons wrote a reply+100 XP
6mos ago
That's a good point! However this is the logic for panel into the "private area".
Many errors would "redundant". In example if new_password is missing, I just need to have an error saying "password missing". I don't need "password missing" and "passwords don't match".
thesimons wrote a reply+100 XP
6mos ago
I have redacted the guard with a generic "foo" for privacy.
thesimons started a new conversation+100 XP
6mos ago
Hello,
don't kill me please. I tried the Laravel "validation" style but I'm unable to get the same result for the following (dirty) code.
public function update(Request $request)
{
if (empty($request->current_password)) {
return back()->withInput()
->with('error', 'lang.profile.settings.preferences.password.current_password.error.required')
->with('hasLinkBack', true);
}
if (empty($request->new_password)) {
return back()->withInput()
->with('error', 'lang.profile.settings.preferences.password.new_password.error.required')
->with('hasLinkBack', true);
}
if (strlen($request->new_password) < 8) {
return back()->withInput()
->with('error', 'lang.profile.settings.preferences.password.new_password.error.min')
->with('hasLinkBack', true);
}
if (empty($request->new_password_verify)) {
return back()->withInput()
->with('error', 'lang.profile.settings.preferences.password.new_password_verify.error.required')
->with('hasLinkBack', true);
}
if ($request->new_password !== $request->new_password_verify) {
return back()->withInput()
->with('error', 'lang.profile.settings.preferences.password.new_password_verify.error.different')
->with('hasLinkBack', true);
}
// Check current password
if (!Hash::check($request->current_password, auth('foo')->user()->password)) {
return back()->withInput()
->with('error', 'lang.profile.settings.preferences.password.current_password.error.incorrect')
->with('hasLinkBack', true);
}
// Update password
auth('foo')->user()->update(['password' => Hash::make($request->new_password)]);
return redirect()
->route('my.profile.settings.preferences.password.edit')
->with('success', 'lang.profile.settings.preferences.password.updated_successfully');
}
Basically I want to flash one error at time. Could you please suggest a cleaner approach?
Thanks Simon