How to show the value from other database in a view? i am using multi database. My Controller :
public function index()
{
$oil = DB::connection('mysql2')->table('oils')->select('oil_price')->get();
$this->oil = [
'oil_price' => $oil
];
return view('home')->with('oil', $this->oil);
}
This is my view :
{{$oil['oil_price']}}
Output is : enter image description here
I want show only 10000.