I was referred to Juggling Larger Laravel Applications and I'm havihng trouble getting
View::addNamespace('Marketing', __DIR__.'/../Views')
to work in one of my sub-app directories where the views are located at /var/www/myapp.com/app/MyApp/Marketing/Views
Placing this code in my /var/www/myapp.com/app/MyApp/Marketing/Providers/MarketingServiceProvider.php
<?php namespace MyApp\Marketing\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\View;
class MarketingServiceProvider extends ServiceProvider
{
public function register()
{
}
public function boot()
{
require_once(__DIR__.'/../routes.php');
View::addNamespace('Marketing', __DIR__.'/../Views');
}
}
and referencing it in my routes file like
Route::group(array('domain' => array('www.myapp.dev')), function()
{
return View::make('Marketing::index');
});
results in No hint path defined for [Marketing].
I've also added
MyApp\Marketing\Providers\MarketingServiceProvider
to the provider's config array.
Lastly, I'm using psr-0 in composer
"autoload": {
"psr-0": {
"MyApp": "app/"
},