Advertisements

Laravel filter model data

Advertisements

Laravel filter model data

$user = User::get();
$user_details = $user->filter(function ($value, $key) {         
    if ($value->email == 'example.com') {
        return false;
    }else{
        return true;
    }      
});

click for more Laravel codes read about laravel collections