NULL COALESCE Operator w PHP (Laravel)
public function show($name){
$data = [
'twitter' => 'codewithchinekwe',
'age' => '23',
];
return view('products.index', [
'products' => $data[$name] ?? 'product ' .$name. 'doesn\'t exist'
]);
}
Lovely Louse