mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-12 08:26:44 +01:00
Shift to consistent, fluent response chains
This commit is contained in:
parent
dce4ad2a74
commit
a526f2c3f8
6 changed files with 13 additions and 13 deletions
|
@ -33,7 +33,7 @@ class AccountController extends Controller
|
||||||
|
|
||||||
public function getRegister()
|
public function getRegister()
|
||||||
{
|
{
|
||||||
return redirect(config('poniverse.urls')['register']);
|
return redirect()->to(config('poniverse.urls')['register']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNotifications()
|
public function getNotifications()
|
||||||
|
|
|
@ -50,14 +50,14 @@ class AuthController extends Controller
|
||||||
->getAuthorizationUrl());
|
->getAuthorizationUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect('/');
|
return redirect()->to('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postLogout()
|
public function postLogout()
|
||||||
{
|
{
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
|
|
||||||
return redirect('/');
|
return redirect()->to('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOAuth(Request $request)
|
public function getOAuth(Request $request)
|
||||||
|
@ -74,7 +74,7 @@ class AuthController extends Controller
|
||||||
} catch (IdentityProviderException $e) {
|
} catch (IdentityProviderException $e) {
|
||||||
Log::error($e);
|
Log::error($e);
|
||||||
|
|
||||||
return redirect('/')->with(
|
return redirect()->to('/')->with(
|
||||||
'message',
|
'message',
|
||||||
'Unfortunately we are having problems attempting to log you in at the moment. Please try again at a later time.'
|
'Unfortunately we are having problems attempting to log you in at the moment. Please try again at a later time.'
|
||||||
);
|
);
|
||||||
|
@ -161,6 +161,6 @@ class AuthController extends Controller
|
||||||
{
|
{
|
||||||
Auth::login($user, $rememberMe);
|
Auth::login($user, $rememberMe);
|
||||||
|
|
||||||
return redirect('/');
|
return redirect()->to('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,13 @@ class ImagesController extends Controller
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = response('', 200);
|
$response = response()->noContent(200);
|
||||||
$filename = $image->getFile($coverType['id']);
|
$filename = $image->getFile($coverType['id']);
|
||||||
|
|
||||||
if (! is_file($filename)) {
|
if (! is_file($filename)) {
|
||||||
$redirect = url('/images/icons/profile_'.Image::$ImageTypes[$coverType['id']]['name'].'.png');
|
$redirect = url('/images/icons/profile_'.Image::$ImageTypes[$coverType['id']]['name'].'.png');
|
||||||
|
|
||||||
return redirect($redirect);
|
return redirect()->to($redirect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config('app.sendfile')) {
|
if (config('app.sendfile')) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ class NotificationsController extends Controller
|
||||||
$email->notification->save();
|
$email->notification->save();
|
||||||
});
|
});
|
||||||
|
|
||||||
return redirect($email->getActivity()->url);
|
return redirect()->to($email->getActivity()->url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEmailUnsubscribe(Request $request, $subscriptionKey)
|
public function getEmailUnsubscribe(Request $request, $subscriptionKey)
|
||||||
|
@ -58,12 +58,12 @@ class NotificationsController extends Controller
|
||||||
return redirect(route('account:settings', [
|
return redirect(route('account:settings', [
|
||||||
'slug' => $subscription->user->slug,
|
'slug' => $subscription->user->slug,
|
||||||
'unsubscribedMessageKey' => $subscription->activity_type,
|
'unsubscribedMessageKey' => $subscription->activity_type,
|
||||||
]), 303);
|
]), );
|
||||||
} else {
|
} else {
|
||||||
return redirect(route('email:confirm-unsubscribed', [
|
return redirect(route('email:confirm-unsubscribed', [
|
||||||
'unsubscribedUser' => $subscription->user->display_name,
|
'unsubscribedUser' => $subscription->user->display_name,
|
||||||
'unsubscribedMessageKey' => $subscription->activity_type,
|
'unsubscribedMessageKey' => $subscription->activity_type,
|
||||||
]), 303);
|
]), );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ class TracksController extends Controller
|
||||||
|
|
||||||
$trackFile = TrackFile::findOrFailByExtension($track->id, $extension);
|
$trackFile = TrackFile::findOrFailByExtension($track->id, $extension);
|
||||||
|
|
||||||
$response = response('', 200);
|
$response = response()->noContent(200);
|
||||||
$filename = $trackFile->getFile();
|
$filename = $trackFile->getFile();
|
||||||
|
|
||||||
if (! file_exists($filename)) {
|
if (! file_exists($filename)) {
|
||||||
|
@ -189,7 +189,7 @@ class TracksController extends Controller
|
||||||
$trackFile = TrackFile::findOrFailByExtension($track->id, $extension);
|
$trackFile = TrackFile::findOrFailByExtension($track->id, $extension);
|
||||||
ResourceLogItem::logItem('track', $id, ResourceLogItem::DOWNLOAD, $trackFile->getFormat()['index']);
|
ResourceLogItem::logItem('track', $id, ResourceLogItem::DOWNLOAD, $trackFile->getFormat()['index']);
|
||||||
|
|
||||||
$response = response('', 200);
|
$response = response()->noContent(200);
|
||||||
$filename = $trackFile->getFile();
|
$filename = $trackFile->getFile();
|
||||||
|
|
||||||
if (config('app.sendfile')) {
|
if (config('app.sendfile')) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ class RedirectIfAuthenticated
|
||||||
|
|
||||||
foreach ($guards as $guard) {
|
foreach ($guards as $guard) {
|
||||||
if (Auth::guard($guard)->check()) {
|
if (Auth::guard($guard)->check()) {
|
||||||
return redirect(RouteServiceProvider::HOME);
|
return redirect()->to(RouteServiceProvider::HOME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue