How do I catch an exception in a controller in Laravel?
In my controller I need to test a custom database connection and if that is bad, return an error. The problem is the block is catch
not working ... I am getting an exception that is defined globally in app/start/global.php
.
try {
DB::connection('test');
} catch (Exception $e) {
dd('error');
}
+3
source to share