public function allTransactions(int $id)
    {
        /** @var HasTransactionsInterface $object */
        if(!$object = $this->repository->find($id)) {
            abort(404);
        }

        $transactions = $object->getLatestTransactions();

        return TransactionResource::collection($transactions);
    }
public function allTransactions(int $id)
    {
        /** @var HasTransactionsInterface $object */
        if(!$object = $this->repository->find($id)) {
            abort(404);
        }

        $transactions = $object->getLatestTransactions();

        return TransactionResource::collection($transactions);
    }
public function allTransactions ( int $ id ) { /** @var HasTransactionsInterface $object */ if ( ! $ object = $ this -> repository -> find ( $ id ) ) { abort ( 404 ) ; } $ transactions = $ object -> getLatestTransactions ( ) ; return TransactionResource :: collection ( $ transactions ) ; }
Get latest Transactions

Get all transactions order by created desc for given model find by model primary id

@param int $id

@return AnonymousResourceCollection|TransactionResource[]
Get latest Transactions