Laravel-modules: Error when using API Resource

Created on 20 Dec 2017  路  1Comment  路  Source: nWidart/laravel-modules

return new CustomerResource(Customer::find(1));
when I write this snippet in my controller, it gives me an error { "message": "Undefined property: Illuminate\\Database\\Query\\Builder::$id" because $this context not defined in CustomerResource file, how to fix it ?

>All comments

Hello,

This is not related to this package. Please make sure to check the laravel documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

developh picture developh  路  3Comments

ojasseh picture ojasseh  路  3Comments

alexandretaz picture alexandretaz  路  3Comments

vdjkelly picture vdjkelly  路  4Comments

Levivb picture Levivb  路  4Comments