Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Laravel check for constraint violation

try {
  // ...

} catch (IlluminateDatabaseQueryException $e) {
    var_dump($e->errorInfo);
}

// Example output from MySQL
array (size=3)
   0 => string '23000' (length=5)
   1 => int 1452
   2 => string 'Cannot add or update a child row: a foreign key constraint fails (...)'
Comment

PREVIOUS NEXT
Code Example
Php :: multe data on database laravel 
Php :: check if custom post type exists 
Php :: php get duplicate keys in array without using inbuilt function 
Php :: php max int 
Php :: isset 
Php :: download npm package 
Php :: PDO Prepared Statement php 
Php :: laravel simple pagination 
Php :: make controller and model laravel 
Php :: what is lang in laravel 
Php :: in date function + 1 month and - 1 day in php 
Php :: what is Laravel Eloquent ORM. 
Php :: sms laravel 
Php :: laravel controller middleware example 
Php :: Laravel PackageManifest.php: Undefined index: name 
Php :: sha256 php cantidad caracteres 
Php :: laravel migration smallint length 
Php :: IP Authorization php code 
Php :: php random number 
Php :: laravel cookie (flash meesage for time) 
Php :: php fake stripe client 
Php :: laravel custom validation 
Php :: Regullar date format for php 
Php :: acf get all checkbox options 
Php :: wp wc php if not is single product page 
Php :: how to show login user name in php 
Php :: console_log in php 
Php :: php ifelse 
Php :: laravel repository update multiple row 
Php :: how does substr_compare() works PHP 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =