$rate = DB::table('rates')
->leftJoin('currencies as fc', 'rates.from', '=', 'fc.id')
->leftJoin('currencies as tc', 'rates.to', '=', 'tc.id')
->where('fc.name', $from)
->where('tc.name', $to)
->select()
->first();
`
но оно уже через eloquent
https://laravel.com/docs/5.8/eloquent-relationships
Обсуждают сегодня