(Update) Refactor HTTP Redirects

- Use global redirect() helper instead of facade
This commit is contained in:
HDVinnie
2018-02-16 14:07:24 -05:00
parent 9893abfbb5
commit 8a8f440781
46 changed files with 161 additions and 260 deletions
+2 -5
View File
@@ -14,11 +14,8 @@ namespace App\Http\Controllers;
use App\Thank;
use App\Torrent;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Redirect;
use \Toastr;
class ThankController extends Controller
@@ -37,7 +34,7 @@ class ThankController extends Controller
$thank = Thank::where('user_id', '=', $user->id)->where('torrent_id', '=', $torrent->id)->first();
if ($thank) {
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('You Have Already Thanked On This Torrent!', 'Whoops!', ['options']));
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('You Have Already Thanked On This Torrent!', 'Whoops!', ['options']));
}
$thank = new Thank();
@@ -45,6 +42,6 @@ class ThankController extends Controller
$thank->torrent_id = $torrent->id;
$thank->save();
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::success('Your Thank Was Successfully Applied!', 'Yay!', ['options']));
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::success('Your Thank Was Successfully Applied!', 'Yay!', ['options']));
}
}