Skip to content

Glossary: Laravel

compact()

A PHP function that builds an array from variable names: compact('products') is ['products' => $products]. Controllers use it to pass data to views.

Where the book teaches it

Related terms

View