I am making a blog with Laravel and here, users can subscribe for newsletters. The thing is I am planning to use mailchimp and I need to make all the necessary interfaces, classes and service providers.
After watching laracasts take on this, they put all the files in app\Acme\Newsletters
and app\Acme\Notify
. But that was in Laravel 4. Now there are separate folders for providers. So should place interfaces and classes in app\Blog\Newsletters
and service providers in their dedicated folder, or all in one?
And since in the autoload there is already a psr-4 directory defined
psr-4 : {"App\" : "app/"}
I do not need to edit the autoload, since the Blog directory is inside the app/
?
It is your own decision where to place your classes and interfaces as laravel uses psr-4 autoloading. You only need to pay attention to your namespace usage. If you want to place your classes within app\Blog\Newsletters you must namespace them with \App\Blog\Newsletters
. As services providers are registered within config\app.php you are also free to place them everywhere you want. Laravel resolves this for you.