Compact is a php function compact() function is used to create an array containing variables and their respective values. This function take variable names as its parameters and returns an array where the key are the variable names and the values are the variable values .It’s commonly used to pass data to views in laravel. […]