public function redirectBack($message, $payload = [])
{
// Determine if the developer has disabled HTML views
$views = config('sentinel.views_enabled');
// If views have been disabled, return a JSON response
if (!$views || Request::ajax() || Request::pjax()) {
return Response::json(array_merge($payload, $message), 400);
}
// Do we need to flash any session data?
if ($message) {
$status = key($message);
$text = current($message);
Session::flash($status, $text);
}
// Go back
return redirect()->back()->withInput()->with($payload);
}