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,23 +56,17 @@ class ApplicationController extends Controller
|
||||
{
|
||||
$this->authorize('view', $application);
|
||||
|
||||
if (!is_null($application)) {
|
||||
return view('dashboard.user.viewapp')
|
||||
->with(
|
||||
[
|
||||
'application' => $application,
|
||||
'comments' => $application->comments,
|
||||
'structuredResponses' => json_decode($application->response->responseData, true),
|
||||
'formStructure' => $application->response->form,
|
||||
'vacancy' => $application->response->vacancy,
|
||||
'canVote' => $this->applicationService->canVote($application->votes),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$request->session()->flash('error', __('The application you requested could not be found.'));
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
return view('dashboard.user.viewapp')
|
||||
->with(
|
||||
[
|
||||
'application' => $application,
|
||||
'comments' => $application->comments,
|
||||
'structuredResponses' => json_decode($application->response->responseData, true),
|
||||
'formStructure' => $application->response->form,
|
||||
'vacancy' => $application->response->vacancy,
|
||||
'canVote' => $this->applicationService->canVote($application->votes),
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user