dingo / dingo/api

use __get() images method

Open
#1,691 1 comment 0 reactions 1 assignee Claimed by @specialtactics View on GitHub
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.