beyondcode / laravel-self-diagnosis

Perform Self-Diagnosis Tests On Your Laravel Application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StorageDirectoryIsLinked fails on Windows

denisrpriebe opened this issue · comments

I'm running Windows 10 with Laravel Homestead. After doing some research on symbolic linking, Windows does not support symbolic links and the filetype() helper function will return dir instead of link. This will cause StorageDirectoryIsLinked to fail. Perhaps an alteration such as this will suffice?

StorageDirectoryIsLinked.php :

    /**
     * Perform the actual verification of this check.
     *
     * @return bool
     */
    public function check(): bool
    {
        try {
            return in_array($this->filesystem->type(public_path('storage')), ['link', 'dir']);
        } catch (\Exception $e) {
            return false;
        }
    }

Let me know about the above I can do a PR if you would like.

Thanks.

I just changed the check to isDirectory as it will resolve symlinks internally too! :)