i follow this link
to create project hmvc in laravel
my structure file like this
+ [app]
+ [Another Directory]
+ [modules]
+ [content]
+ [shop]
+ [controllers]
- ShopController.php
+ [view]
- home.blade.php
- route.php
- ServiceProvider.php
- ServiceProvider.php
+ [Another Directory]
this is my shopController.php
<?php
namespace App\Modules\Shop\Controllers;
use App\Controllers\BaseController;
use View;
class ShopController extends BaseController {
public function showWelcome() {
return View::make('shop::home');
}
}
and this is my route in shop module
<?php
Route::get('/shop', 'App\\Modules\\Shop\\Controllers\\ShopController@showWelcome');
i try to test return simple hello string from route in shop module and it's working
<?php
Route::get('admin/shop', function() {
return '<h1>Hello</h1>';
});
but where i'm missing
so can't display view from route or controller in hmvc
@update Jan.J
route in shop module
//this is working
Route::get('admin/shop', function() {
return '<h1>hello</h1>';
});
//this is working, result laravel default page hello in view mvc
// but i can't dispay view in shop module
Route::get('admin/shop', function() {
return View::make('hello');
});
//i try your script something like this, and it's not working
//correct me if i'm wrong
Route::get('/shop', 'new App\Modules\Shop\Controllers\ShopController(app('request'));');
@update
i try to update my shop route to call view in shop module like this
<?php
Route::get('test/', function() {
return View::make(‘shop::home’);
});
and it's give result
Class '‘shop' not found
any idea?
composer autoload
. – Jan.Jnew App\Modules\Shop\Controllers\ShopController(app('request'));
– Jan.J