Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use __get() images method #1691

Open
CrazyZard opened this issue Dec 13, 2019 · 1 comment
Open

use __get() images method #1691

CrazyZard opened this issue Dec 13, 2019 · 1 comment
Assignees

Comments

@CrazyZard
Copy link

Q A
Bug? yes
New Feature? yes
Framework Laravel
Framework version 5.8.10
Package version 2.0.0-alpha2
PHP version 7.3

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
{

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);
}
}

@specialtactics
Copy link
Member

Hi

First of all, your dingo version is extremely old and needs to be updated.

Secondly, you code example doesn't have the use of the Helper class that you mentioned? I'm not really following.

@specialtactics specialtactics self-assigned this Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants