Created
December 19, 2013 18:08
Revisions
-
sorora created this gist
Dec 19, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ <?php namespace MyApp\Models\Repositories; abstract class EloquentBaseRepository { protected $model; public function __construct() { $model = explode('\\', get_class($this)); $this->model = $model[count($model)-2]; } public function example() { return call_user_func_array(array($this->model, 'example'), func_get_args()); } public function example2() { return call_user_func_array(array($this->model, 'example2'), func_get_args()); } }