My problem is with Query Builder. There a two tables called "Company" and "orders". I want to list all orders, and inside each order I want to see data about relative Company.
$builder->columns(['object.*','company.*']); $builder->addFrom("ReadyApp\Api\Models\Order","object"); $builder->innerJoin('ReadyApp\Api\Models\Company', 'company.id = object.company_id','company'); $builder->where('object.client_id = :client_id:',['client_id'=>$id]); $builder->orderBy('object.id DESC'); $builder->groupBy('object.id');
The problem is my json returns a private atributes (columns) without use Getter and Setter passwords. Inside Company table, has a password column, I don't want to show this password column, but my JSON shows all values from table. thanks.