SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (esi.users, CONSTRAINTusers_role_id_foreignFOREIGN KEY (role_id) REFERENCESroles(id)) (SQL: delete fromroles)
at C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {
> 671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|
1 C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:489
PDOException::("SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (esi.users, CONSTRAINTusers_role_id_foreignFOREIGN KEY (role_id) REFERENCESroles(id))")
Illuminate\Database\QueryException
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (
esi.
users, CONSTRAINT
users_role_id_foreignFOREIGN KEY (
role_id) REFERENCES
roles(
id)) (SQL: delete from
roles)
at C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671
1 C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:489
PDOException::("SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (
esi.
users, CONSTRAINT
users_role_id_foreignFOREIGN KEY (
role_id) REFERENCES
roles(
id))")
2 C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:489
PDOStatement::execute()