include('sidebar', ['menu' => ['Home', 'About', 'Contact']]) method passes a menu variable to the sidebar.php view.
Inside sidebar.php, the $menu array will be accessible.
Advanced Include Features
Expanding the project to include a users’ folder.Relative Include
To include a view relative to the current view file prefix the include value with::
Conditional Include
You can also include withincludeIf() which will only include the view if conditionals are meet: