Laravel 5.3 - About Changing the App Directory

Asked

Viewed 694 times

2

I created a project, within the project I created my own file structure instead of using the App folder, so I created a call Massoterapia, in the documentation informs that it is necessary to change the namespace and I did the following:

php Artisan app:name Massotherapy

Now the project besides the App folder, now has the Massotherapy folder, but when I try to use the classes that are in Massotherapy, it is always giving Class Not Found, but the namespace and use are right, what could be?

1 answer

2


In the archive composer.json alter:

"psr-4": {
    "Massoterapia\\": "app/"
}

for

"psr-4": {
    "Massoterapia\\": "nome_do_novo_diretorio/"
}
  • 1

    Only one thing I didn’t know is that after editing Composer.json, you would need to execute the command: Composer dumpautoload Thanks for the help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.