Answers for "exception in php or try catch in php"

PHP
0

exception in php or try catch in php

public function search(Request $request)
{
    try {
        $user = $this->userService->search($request->input('user_id'));
    } catch (ModelNotFoundException $exception) {
        return back()->withError($exception->getMessage())->withInput();
    }
    return view('users.search', compact('user'));
}
Posted by: Guest on February-22-2022

Code answers related to "exception in php or try catch in php"

Browse Popular Code Answers by Language