php - Which controller should laravel packages extend from -


building package laravel 5, containing models, views & controllers. controller should packages extend avoid problems, if consumer of package, might have changed application default namespace different.

i come across tutorials , blog-posts people use app\http\controllers\controller explaining how build package laravel.

namespace devdojo\calculator;  use illuminate\http\request; use app\http\requests; use app\http\controllers\controller; //<---   class calculatorcontroller extends controller {     public function add($a, $b){         return $a + $b;     }      public function subtract($a, $b){         return $a - $b;     } } 

i can see benefits of using applications controller, developer may have made adjustments, using class packagecontroller extends app\http\controllers\controller in package might not correct solution, it?!

the same might apply app\http\requests
, app\user (for user/auth found solution here).


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -