when I use __set($key) in my controller and use Dingo\Api\Routing\Helpers to return Data;
The system return me "Call to a member function collection() on null"
Code
class Controller extends BaseController
{
use Helpers;
public function __set($key)
{
if($key == 'auth_user'){
return Request::user();
}
return $key;
}
public function index(){
$list = User::all();
return $this->response->collection($list, NotifyTransformer::class);
}
}
Actual Behaviour
when I use __set($key) in my controller and use Dingo\Api\Routing\Helpers to return Data; The system return me "Call to a member function collection() on null"
Code
class Controller extends BaseController {
public function __set($key) { if($key == 'auth_user'){ return Request::user(); } return $key; }
public function index(){ $list = User::all(); return $this->response->collection($list, NotifyTransformer::class); } }