compact Compact function allows you to pass data to the view. #laravel#view $color = 'blue'; $shape = 'square'; view('geometry',compact("color","shape")); copy