samedi 6 juillet 2019

is_dir() expects parameter 1 to be a valid path, string given - Laravel 5.8 [duplicate]

This question already has an answer here:

I have downloaded Laravel site in my Ubuntu (ru after that composer update) and I am getting this error, when try to access the site:

is_dir() expects parameter 1 to be a valid path, string given

I see that the problem is in /vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php, where the code is:

protected function loadViewsFrom($path, $namespace){

    if (is_array($this->app->config['view']['paths'])) {

        foreach ($this->app->config['view']['paths'] as $viewPath) {

            if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) {
                $this->app['view']->addNamespace($namespace, $appPath);
            }
        }
    }

    $this->app['view']->addNamespace($namespace, $path);
}

$appPath is string yes, but isn't it argument of type string for this function ?

If I put var_dump() right before is_dir check like this var_dump($viewPath.'/vendor/'.$namespace);exit, I am getting two paths:

string(74) "/mnt/e/xampp/htdocs/project_folder/resources/views/vendor/notifications"

string(71) "/mnt/e/xampp/htdocs/project_folder/resources/views/vendor/pagination"

These two folders in views folder doesn't exists. It doesn't matter, if I create them, but I think creating them is wrong. I can't understand where is the error.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire