Hello, i just started learning coding
why do i get RootTagMissingFromViewException error when i use Switch case
public function render()
{
$current_timestamp = Carbon::now()->timestamp; // Unix timestamp 1495062127
$date = Carbon::parse($current_timestamp)->format('l, d F Y');
$current_time = Carbon::parse($current_timestamp);
$greet = floor( $current_time->hour / 6 );
switch ($greet) {
case 0:
return "Good night!";
break;
case 1:
return "Good morning!";
break;
case 2:
return "Good afternoon!";
break;
case 3:
return "Good evening!";
break;
};
return view('livewire.greater', [
'date' => $date,
'greet' => $greet,
]);
}
if i remove the switch case then the page renders fine
i dont get it ?