Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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'));
}
Source by laraveldaily.com #
 
PREVIOUS NEXT
Tagged: #exception #php #catch #php
ADD COMMENT
Topic
Name
1+7 =