<?php
namespace App\Http\Controllers\Api\V1;use App\Http\Controllers\Controller;use App\Http\Requests\QuoteRequest;use App\Http\Resources\MoneyResource;use App\Models\Corridor;use App\Services\QuoteService;
class QuoteController extends Controller {public function __invoke(QuoteRequest $r,QuoteService $s){$q=$s->quote($r->user(),Corridor::findOrFail($r->integer('corridor_id')),$r->integer('send_amount_minor'));return ['data'=>['send_amount'=>new MoneyResource($q['send_amount_minor'],$q['send_currency']),'fee'=>new MoneyResource($q['fee_minor'],$q['send_currency']),'payout_amount'=>new MoneyResource($q['payout_amount_minor'],$q['receive_currency']),'rate_used'=>$q['rate_used'],'margin_percent_used'=>$q['margin_percent_used'],'quote_token'=>$q['quote_token'],'expires_at'=>$q['expires_at']]];}}
