If I assigned an object to the model instance variable, how would I use call_user_func_array on it?
use App\Repositories\BaseRepositoryDynamic as BR;
$repo = new BR();
$repo->model=new User();
$repo->first();
class BaseRepositoryDynamic
{
public $model;
public function __call($name, $parameters=[])
{
call_user_func_array($this->model->$name, $parameters);
}
}
I'm getting this error:
call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /Users/admin/Projects/app/Repositories/BaseRepositoryDynamic.php on line 16