try{ Db::name('user')->find(); }catch(\Exception $e){ $this->error($e->getMessage()); }$ this-> success ( 'executed successfully!');
PHP can be used to capture the abnormal necessary treatment, but need a little attention, do not use in abnormal capture think \ Controller class
exception handling
--427--
of error, success and redirect method, since the above-mentioned three methods will throw HttpResponseException exceptions, thus affecting positive
constant exception caught, for example: