LaraDumps
  • What is LaraDumps?
  • Get Started
    • Installation
    • Configuration
  • Commands
    • Simple
    • Color
    • Log Application
    • Show queries
    • Clear History
    • Custom Label
    • JSON Validate
    • Contains
    • Table
    • Screens
    • Diff
    • Model
  • Reference
    • Livewire
  • App
    • Host
    • IDE
Powered by GitBook
On this page
  1. Commands

Diff

PreviousScreensNextModel

Last updated 2 years ago

Sometimes you may want to quickly compare one variable with another, for that use diff()

ds()->diff('This is an example text', 'This is an example of content');

$array1 = [
    'name'      => 'Luan',
    'last_name' => 'Freitas',
    'is_active' => false,
];

$array2 = [
    'name'      => 'Luan',
    'last_name' => 'Freitas',
    'is_active' => true,
];

ds()->diff($array1, $array2, true);