Laravel Artisan issues a command

I am trying to create middleware using artisan php artisan make:middleware AuthorizedUserOnly, but I am getting ErrorExceptionas shown below.

file_get_contents (/mysite.com/www/local/composer.json) Could not open the stream without such a file or directory.

This is my document root.

-local
  -Laravel application folders
  -artisan
-index.php
-composer.json
.htaccess

I changed the directory structure for working with shared hosting. And it worked fine.

KEY NOTES

  • Other teams artisanwork. As I tried php artisan route:listand php artisan config:cacheand php artisan tinker.
  • This directory structure works just fine. But as the error says, it tries to find it composer.jsonin the directory localwhile it is on document root. Team
  • php artisan make:model uses the same Exception

What could be the problem and solution?

+4
1

. composer.json local, . ,

-local
  -Laravel Application Folders
  -composer.json
  -artisan
-index.php
.htaccess

?

. . php artisan make . , , composer dump-autoload. composer , artisan , local .

laravel SHARED HOSTING, laravel DOESNOT RECOMMEND.

laravel, . .

+1

Source: https://habr.com/ru/post/1676799/


All Articles