Reference
We asume you have completed the installation of the Ray package or library in your project.
To display something in Ray use the ray()
function. It accepts everything: strings, arrays, objects, ... you name it.
Framework agnostic PHP
Call | Description |
---|---|
ray($variable) |
Display a string, array or object |
ray($variable, $another, …) |
Ray accepts multiple arguments |
ray()->backtrace() |
Check entire backtrace |
ray(…)->blue() |
Output in blue |
ray()->caller() |
Discover where code is being called |
ray()->carbon($carbon) |
Send Carbon instances to Ray |
ray()->className($object) |
Send the classname of an object to Ray |
ray()->clearScreen() |
Clear current screen |
ray()->clearAll() |
Clear current and all previous screens |
ray()->count() |
Count how many times a piece of code is called |
ray(…)->die() or rd(…) |
Stop the PHP process |
ray()->disable() |
Disable sending stuff to Ray |
ray()->disabled() |
Check if Ray is disabled |
ray()->enable() |
Enable sending stuff to Ray |
ray()->enabled() |
Check if Ray is enabled |
ray()->file($path) |
Display contents of a file |
ray(…)->gray() |
Output in gray |
ray(…)->green() |
Output in green |
ray(…)->hide() |
Display something in Ray and make it collapse immediately |
ray()->hideApp() |
Hide the app |
ray()->html($html) |
Render a piece of HTML |
ray()->image($path) |
Display an image form a path or URL |
ray()->json($json, $another, …) |
Send one or more valid JSON strings to Ray |
ray(…)->large() |
Output text bigger |
ray()->measure() |
Display runtime and memory usage. When measure is called again, the time between this and previous call is also displayed |
ray()->newScreen() |
Start a new screen |
ray()->newScreen('title') |
Start a new named screen |
ray(…)->notify($message) |
Display a notification |
ray(…)->orange() |
Output in orange |
ray(…)->pass($variable) |
Display something in Ray and return the value instead of a Ray instance |
ray()->pause() |
Pause execution |
ray()->phpinfo() |
Display PHP info |
ray()->phpinfo($key, $another, …) |
Display specific parts of PHP info |
ray(…)->purple() |
Output in purple |
ray()->raw($value) |
Send raw output of a value to Ray without fancy formatting |
ray(…)->red() |
Output in red |
ray()->showApp() |
Bring the app to the foreground |
ray(…)->showIf(true) |
Conditionally show things based on a truthy value or callable |
ray(…)->small() |
Output text smaller |
ray()->table($array. $label) |
Format an associative array with optional label |
ray()->toJson($variable, $another, … ) |
Display the JSON representation of 1 or more values that can be converted |
ray()->trace() |
Check entire backtrace |
ray()->xml($xmlString) |
Display formatted XML in Ray |
Updating a Ray instance
Call | Description |
---|---|
$ray->large() |
Update the size of a Ray instance. Use large() or small |
$ray->red() |
Update the color of a Ray instance. Use green() , orange() , red() , blue() ,purple() or gray() |
$ray->remove() |
Remove an item from Ray |
$ray->removeWhen(true) |
Conditionally remove an item based on a truthy value or callable |
$ray->send() |
Update the content of a Ray instance |
Read more on Framework agnostic PHP
Laravel
Call | Description |
---|---|
ray()->mailable($mailable) |
Render a mailable |
ray()->markdown($markdown) |
Render markdown |
ray()->model($model) |
Display the attributes and relations of a model |
ray()->showCache() |
Display all cache events that are executed |
ray()->showCache(callable) |
Display all cache events that are executed within a callable |
ray()->stopShowingCache() |
Stop displaying cache events |
ray()->showEvents() |
Display all events that are executed |
ray()->showEvents(callable) |
Display all events that are executed within a callable |
ray()->stopShowingEvents() |
Stop displaying events |
ray()->showJobs() |
Display all jobs that are executed |
ray()->showJobs(callable) |
Display all jobs that are executed within a callable |
ray()->stopShowingJobs() |
Stop displaying jobs |
ray()->showQueries() |
Display all queries that are executed |
ray()->showQueries(callable) |
Display all queries that are executed within a callable |
ray()->stopShowingQueries() |
Stop displaying queries |
ray()->showRequests() |
Display all requests |
ray()->stopShowingRequests() |
Stop displaying requests |
ray()->showViews() |
Display all views |
ray()->stopShowingViews() |
Stop displaying views |
Macros & Blade
Call | Description |
---|---|
collect([…])->ray('title') |
Use the Ray collection macro to easily send collections to Ray |
@ray($variable, $another, …) |
Send to Ray from a Blade view |
$this->get(…)->ray()->assertSuccessful() |
Send a TestResponse to Ray. Chain on any of Laravel's assertion methods |
Read more on Laravel
Wordpress
Call | Description |
---|---|
ray()->showQueries() |
Display all queries that are executed |
ray()->stopShowingQueries() |
Stop displaying queries |
ray()->showMails() |
Display all mails that are sent |
ray()->stopShowingMails() |
Stop displaying mails |
Read more on WordPress
Yii
Call | Description |
---|---|
ray()->showEvents() |
Display all events that are executed |
ray()->showEvents(callable) |
Display all events that are executed within a callable |
ray()->stopShowingEvents() |
Stop displaying events |
ray()->showQueries() |
Display all queries that are executed |
ray()->showQueries(callable) |
Display all queries that are executed within a callable |
ray()->stopShowingQueries() |
Stop displaying queries |
Read more on Yii
Craft
Call | Description |
---|---|
ray()->showEvents() |
Display all events that are executed |
ray()->showEvents(callable) |
Display all events that are executed within a callable |
ray()->stopShowingEvents() |
Stop displaying events |
ray()->showQueries() |
Display all queries that are executed |
ray()->showQueries(callable) |
Display all queries that are executed within a callable |
ray()->stopShowingQueries() |
Stop displaying queries |
Twig
Call | Description |
---|---|
{{ ray(variable, another) }} |
Use Ray in Twig |
{{ variable | ray }} |
Use Ray as filter |
{{ ray.clearScreen }} |
Ray methods are also available on the global variable |
Read more on Craft
JavaScript
Call | Description |
---|---|
ray(variable) |
Display a string, array or object |
ray(variable, another, …) |
Ray accepts multiple arguments |
ray(…).color('blue') |
Output in color. Use green , orange , red , blue ,purple or gray |
ray().clearScreen() |
Clear current screen |
ray().clearAll() |
Clear current and all previous screens |
ray(…).hide() |
Display something in Ray and make it collapse immediately |
ray(JSON.parse([…])) |
Send JSON to Ray |
ray().newScreen() |
Start a new screen |
ray().newScreen('title') |
Start a new named screen |
ray(…).notify(message) |
Display a notification |
ray(…).pass(variable) |
Display something in Ray and return the value instead of a Ray instance |
ray(…).showIf(true) |
Conditionally show things based on a truthy value or callable |
ray(…).size('small') |
Output text smaller or bigger. Use large or small |
NodeJS
Call | Description |
---|---|
ray(variable) |
Display a string, array or object |
ray(variable, another, …) |
Ray accepts multiple arguments |
ray(…).blue() |
Output in color. Use green , orange , red , blue ,purple or gray |
ray()->caller() |
Discover where code is being called |
ray().clearScreen() |
Clear current screen |
ray().clearAll() |
Clear current and all previous screens |
ray().count(name) |
Count how many times a piece of code is called, with optional name |
ray().date(date, format) |
Display a formatted date, the timezone, and its timestamp |
ray().die() |
Halt code execution - NodeJS only |
ray().disable() |
Disable sending stuff to Ray |
ray().disabled() |
Check if Ray is disabled |
ray().enable() |
Enable sending stuff to Ray |
ray().enabled() |
Check if Ray is enabled |
ray().error(err) |
Display information about an error or exception |
ray().event(name, data) |
Display information about an event with optional data |
ray().file(filename) |
Display contents of a file - NodeJS only |
ray(…).hide() |
Display something in Ray and make it collapse immediately |
ray().hideApp() |
Programmatically hide the Ray app window |
ray().html(string) |
Send HTML to Ray |
ray().image(url) |
Display an image in Ray |
ray().json([…]) |
Send JSON to Ray |
ray().measure(callable) |
Measure the performance of a callback function |
ray().measure() |
Begin measuring the overall time and elapsed time since previous measure() call |
ray().newScreen() |
Start a new screen |
ray().newScreen('title') |
Start a new named screen |
ray(…).notify(message) |
Display a notification |
ray(…).pass(variable) |
Display something in Ray and return the value instead of a Ray instance |
ray().pause() |
Pause code execution within your code; must be called using await |
ray().showApp() |
Programmatically show the Ray app window |
ray(…).showIf(true) |
Conditionally show things based on a truthy value or callable |
ray(…).showWhen(true) |
Conditionally show things based on a truthy value or callable |
ray(…).small() |
Output text smaller or bigger. Use large or small |
ray().stopTime(name) |
Removes a named stopwatch if specified, otherwise removes all stopwatches |
ray().table(…) |
Display an array of items or an object formatted as a table; Objects and arrays are pretty-printed |
ray()->trace() |
Check entire backtrace |
ray().xml(string) |
Send XML to Ray |
Vue
Call | Description |
---|---|
this.$ray().<method> |
All NodeJS methods listed above are also available |
this.$ray().data() |
Send the component data object to Ray |
this.$ray().props() |
Send the component props to Ray |
this.$ray().ref(name) |
Display the innerHTML of a named ref in Ray |
this.$ray().track(name) |
Display changes to a component's data variable in real time |
this.$ray().untrack(name) |
Stop displaying changes to a component's data variable |
Updating a Ray instance
Call | Description |
---|---|
ray.size('large') |
Update the size of a Ray instance. Use large or small |
ray.color('red') |
Update the color of a Ray instance. Use green , orange , red , blue ,purple or gray |
$ray.remove() |
Remove an item from Ray |
$ray.removeWhen(true) |
Conditionally remove an item based on a truthy value or callable |
$ray.send() |
Update the content of a Ray instance |
Read more on JavaScript