<?phpnamespaceIlluminate\Database;useException;useIlluminate\Support\Str;traitDetectsDeadlocks{/** * Determine if the given exception was caused by a deadlock. * * @param \Exception $e * @return bool */protectedfunctioncausedByDeadlock(Exception$e){$message=$e->getMessage();returnStr::contains($message,['Deadlock found when trying to get lock','deadlock detected','The database file is locked','A table in the database is locked','has been chosen as the deadlock victim',]);}}