1. Home
  2. Laravel
  3. Compact
#laravel#view

Compact function allows you to pass data to the view.

$color = 'blue';
$shape = 'square';

view('geometry',compact("color","shape")); 
copy
Full Laravel cheatsheet
Sitemap Git repository