Illuminate\Database\Eloquent\ dengan try catch code example
Example: laravel handle queryexception
try {
$this->model->create($data);
} catch (Illuminate\Database\QueryException $e) {
dd($e);
} catch (PDOException $e) {
dd($e);
}
try {
$this->model->create($data);
} catch (Illuminate\Database\QueryException $e) {
dd($e);
} catch (PDOException $e) {
dd($e);
}