Level 61
Your IDE is not aware of aliases defined in the framework.
I would replace that use statement with
use Illuminate\Support\Facades\Validator;
Hello :
I got some warnings from phpStorm :
the first : use Validator;=> Undefined class 'Validator'
the second : where('company_id', $companyId) =>Method 'where' not found in \App\Line
Should I add something to my IDE?
use App\Line;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Validator; <= HERE
use App\Http\Resources\Line as LineResources;
class LineController extends BaseController
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$companyId = companyData()->id;
$lines = Line::
where('company_id', $companyId) <= HERE
->get();
return $this->sendResponse(LineResources::collection($lines), 'Lines retrieved successfully.');
}
Please or to participate in this conversation.