$var1 = '..';
$var2 = '..';
return view('layouts', compact('var1', 'var2'));
$var1 = '..';
$var2 = '..';
return view('layouts', [
'var1' => $var1,
'var2' => $var2,
]);
$varData = $this->formatService($responce); // ['var1' => '..', 'var2' => '..']
return view('layouts', $varData);