diff --git a/src/josegonzalez/Dotenv/Loader.php b/src/josegonzalez/Dotenv/Loader.php
index <HASH>..<HASH> 100644
--- a/src/josegonzalez/Dotenv/Loader.php
+++ b/src/josegonzalez/Dotenv/Loader.php
@@ -90,6 +90,13 @@ class Loader
             );
         }
 
+        if (is_dir($this->filepath)) {
+            return $this->raise(
+                'InvalidArgumentException',
+                sprintf("Environment file '%s' is a directory. Should be a file.", $this->filepath)
+            );
+        }
+
         if (!is_readable($this->filepath)) {
             return $this->raise(
                 'InvalidArgumentException',
Throw InvalidArgumentException when env file is actually a directory. Closes #2