Using Ray in Blade views
#Logging variables
You can use the @ray
directive to easily send variables to Ray from inside a Blade view. You can pass as many things as you'd like.
{{-- inside a view --}} @ray($variable, $anotherVariables)
#Show all variables available
You can use the @xray
directive to show all variables available in your Blade file.
#Using measure
You can use the @measure
directive as a shortcut for the ray()->measure()
method to measure the time and memory it takes to render content in your view.
{{-- inside a view --}} @measure @php(sleep(4)) @measure
This will result in the following output: