I created class
PHP Code:
class WebWalker extends ResourceController
{
protected $modelName = 'App\Models\WebWalkerModel';
protected $format = 'json';
public function index() {
return $this->respond($this->model->findAll());
}
}
But phpstorm/vscode don't suggest $this->model->.....
if I add the $model property and add a description to it in PHPDoc, then the autocomplete starts working, Am I doing the right thing?
PHP Code:
class WebWalker extends ResourceController
{
/**
* @var WebWalkerModel
*/
protected $model = 'App\Models\WebWalkerModel';
protected $modelName = 'App\Models\WebWalkerModel';
protected $format = 'json';
public function index() {
return $this->respond($this->model->findAll());
}
}