-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
Milestone
Description
hi
I want to have this url
api/v1/users/124/sender-transactions
and I definde custom relationship in App\User.php
public function getSenderTransactions2Attribute()
{
$transactions = $this->transactions()->where("status",Enum::TRANSACTION_SUCCEED)->get();
$this->senderRequests->each(function ($request) use (&$transactions) {
if ($request->status == Request::STATUS_DONE || $request->status == Request::STATUS_COMPLETE) {
$transaction = new Transaction();
$transaction->price_daryafti = $request->finalPrice;
$transaction->date = $request->miladiDate;
$transaction->id = Enum::REQUEST."-".$request->name;
$transaction->port = Enum::REQUEST;
$transactions->push($transaction);
}
});
return $transactions;
}and in users adapter :
protected function senderTransactions()
{
return $this->hasMany();
}Now I get this error
"message": "JSON API relation HasMany cannot be used for an Eloquent Collection relation.",
I worked befor in previous version of your library
Can you help me?