refactor: remove useless check for existence
Route model binding already returns a 404 if a model is not found through its ID, thus rendering the code performing that validation useless. Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
parent
f43ff4e9a0
commit
81d995cfc7
@ -56,7 +56,6 @@ class ApplicationController extends Controller
|
|||||||
{
|
{
|
||||||
$this->authorize('view', $application);
|
$this->authorize('view', $application);
|
||||||
|
|
||||||
if (!is_null($application)) {
|
|
||||||
return view('dashboard.user.viewapp')
|
return view('dashboard.user.viewapp')
|
||||||
->with(
|
->with(
|
||||||
[
|
[
|
||||||
@ -68,11 +67,6 @@ class ApplicationController extends Controller
|
|||||||
'canVote' => $this->applicationService->canVote($application->votes),
|
'canVote' => $this->applicationService->canVote($application->votes),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
$request->session()->flash('error', __('The application you requested could not be found.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect()->back();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user