php - How to Access to Laravel 5 with Pingpong-Modules to a specific Module -


i new laravel 5 , pingpong-modules https://github.com/pingpong-labs/modules

i want access outsite of modules-directory specific module-function.

my actual configuration is:

i want access method "test()" dashboardcontroller - here best practice?

code of controller 1:

<?php namespace app\http\controllers\admin;  use app\http\controllers\admincontroller; use app\news; use app\newscategory; use app\user; use app\video; use app\videoalbum; use app\photo; use app\photoalbum;  use \pingpong\modules\facades\module; use app\helpers\moduleshelper;   class dashboardcontroller extends admincontroller {      public function __construct()     {         parent::__construct();     }      public function index()     {         $title = "dashboard";          $news = news::count();         $newscategory = newscategory::count();         $users = user::count();         $photo = photo::count();         $photoalbum = photoalbum::count();         $video = video::count();         $videoalbum = videoalbum::count();           return view('admin.dashboard.index',  compact('title','news','newscategory','video','videoalbum','photo',             'photoalbum','users'));     } 

code of controller 2:

<?php namespace modules\users\http\controllers;  use illuminate\routing\controller; use illuminate\support\facades\view;  class userscontroller extends controller {      public function index()     {         return view::make('users::index');     }      public function test() {         return "test";     }  } 

put block wherever want in dashboardcontroller:

$userscontroller = app::make('modules\users\http\controllers\userscontroller'); $userscontroller->test(); 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

sql server - Sharing data between stored procedures -