├── .gitignore ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── logdesk-2.png └── src ├── Client.php ├── Concerns ├── ArgumentConverter.php ├── Hostname.php └── PayloadFactory.php ├── Logdesk.php ├── Payloads ├── BoolPayload.php ├── CarbonPayload.php ├── LogPayload.php ├── NullPayload.php └── Payload.php ├── Request.php └── helpers.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Labkita 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel Logdesk 2 | 3 |

4 | 5 | Total Downloads 6 | 7 | 8 | Latest Stable Version 9 | 10 | 11 | License 12 | 13 |

14 | 15 | insipired by [spatie ray](https://github.com/spatie/laravel-ray) create free version with minimum features. 16 | 17 | ## Installation 18 | 19 | install this package 20 | 21 | ```bash 22 | composer require jhonoryza/logdesk --dev 23 | ``` 24 | 25 | download desktop app here [https://github.com/jhonoryza/logdesk/releases/latest](https://github.com/jhonoryza/logdesk/releases/latest) 26 | 27 | ![image](./logdesk-2.png) 28 | 29 | ## Usage 30 | 31 | ```php 32 | logdesk('ok'); // string 33 | logdesk(new User()); // object 34 | logdesk(['foo' => 'bar') // array 35 | logdesk(true); // boolean 36 | ``` 37 | 38 | you can pass multiple value 39 | 40 | ```php 41 | logdesk('ok', ['foo' => 'bar'], new User()); 42 | ``` 43 | 44 | or you can have behaviour like `dd()` in laravel to die and dump 45 | 46 | ```php 47 | logdeskDie('die'); 48 | ``` 49 | 50 | ### Security 51 | 52 | If you've found a bug regarding security please mail [jardik.oryza@gmail.com](mailto:jardik.oryza@gmail.com) instead of using the issue tracker. 53 | 54 | ## License 55 | 56 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 57 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jhonoryza/logdesk", 3 | "description": "support package for logdesk app", 4 | "type": "library", 5 | "license": "MIT", 6 | "autoload": { 7 | "psr-4": { 8 | "Jhonoryza\\Logdesk\\": "src/" 9 | }, 10 | "files": [ 11 | "src/helpers.php" 12 | ] 13 | }, 14 | "authors": [ 15 | { 16 | "name": "fajar sidik priatna", 17 | "email": "jardik.oryza@gmail.com" 18 | } 19 | ], 20 | "minimum-stability": "dev", 21 | "require": { 22 | "php": "^7.3|^8.0|^8.1", 23 | "ext-curl": "*", 24 | "ext-json": "*", 25 | "symfony/var-dumper": "^4.2|^5.1|^6.0" 26 | }, 27 | "require-dev": { 28 | "illuminate/support": "6.x|^8.18|^9.0|^10.0", 29 | "nesbot/carbon": "^2.63" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "65ac40d0ed1014f2bf4610a7d2ad1b27", 8 | "packages": [ 9 | { 10 | "name": "symfony/deprecation-contracts", 11 | "version": "dev-main", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/symfony/deprecation-contracts.git", 15 | "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", 20 | "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=8.1" 25 | }, 26 | "default-branch": true, 27 | "type": "library", 28 | "extra": { 29 | "branch-alias": { 30 | "dev-main": "3.4-dev" 31 | }, 32 | "thanks": { 33 | "name": "symfony/contracts", 34 | "url": "https://github.com/symfony/contracts" 35 | } 36 | }, 37 | "autoload": { 38 | "files": [ 39 | "function.php" 40 | ] 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "MIT" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "Nicolas Grekas", 49 | "email": "p@tchwork.com" 50 | }, 51 | { 52 | "name": "Symfony Community", 53 | "homepage": "https://symfony.com/contributors" 54 | } 55 | ], 56 | "description": "A generic function and convention to trigger deprecation notices", 57 | "homepage": "https://symfony.com", 58 | "support": { 59 | "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" 60 | }, 61 | "funding": [ 62 | { 63 | "url": "https://symfony.com/sponsor", 64 | "type": "custom" 65 | }, 66 | { 67 | "url": "https://github.com/fabpot", 68 | "type": "github" 69 | }, 70 | { 71 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 72 | "type": "tidelift" 73 | } 74 | ], 75 | "time": "2023-05-23T14:45:45+00:00" 76 | }, 77 | { 78 | "name": "symfony/polyfill-mbstring", 79 | "version": "1.x-dev", 80 | "source": { 81 | "type": "git", 82 | "url": "https://github.com/symfony/polyfill-mbstring.git", 83 | "reference": "42292d99c55abe617799667f454222c54c60e229" 84 | }, 85 | "dist": { 86 | "type": "zip", 87 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", 88 | "reference": "42292d99c55abe617799667f454222c54c60e229", 89 | "shasum": "" 90 | }, 91 | "require": { 92 | "php": ">=7.1" 93 | }, 94 | "provide": { 95 | "ext-mbstring": "*" 96 | }, 97 | "suggest": { 98 | "ext-mbstring": "For best performance" 99 | }, 100 | "default-branch": true, 101 | "type": "library", 102 | "extra": { 103 | "branch-alias": { 104 | "dev-main": "1.28-dev" 105 | }, 106 | "thanks": { 107 | "name": "symfony/polyfill", 108 | "url": "https://github.com/symfony/polyfill" 109 | } 110 | }, 111 | "autoload": { 112 | "files": [ 113 | "bootstrap.php" 114 | ], 115 | "psr-4": { 116 | "Symfony\\Polyfill\\Mbstring\\": "" 117 | } 118 | }, 119 | "notification-url": "https://packagist.org/downloads/", 120 | "license": [ 121 | "MIT" 122 | ], 123 | "authors": [ 124 | { 125 | "name": "Nicolas Grekas", 126 | "email": "p@tchwork.com" 127 | }, 128 | { 129 | "name": "Symfony Community", 130 | "homepage": "https://symfony.com/contributors" 131 | } 132 | ], 133 | "description": "Symfony polyfill for the Mbstring extension", 134 | "homepage": "https://symfony.com", 135 | "keywords": [ 136 | "compatibility", 137 | "mbstring", 138 | "polyfill", 139 | "portable", 140 | "shim" 141 | ], 142 | "support": { 143 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" 144 | }, 145 | "funding": [ 146 | { 147 | "url": "https://symfony.com/sponsor", 148 | "type": "custom" 149 | }, 150 | { 151 | "url": "https://github.com/fabpot", 152 | "type": "github" 153 | }, 154 | { 155 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 156 | "type": "tidelift" 157 | } 158 | ], 159 | "time": "2023-07-28T09:04:16+00:00" 160 | }, 161 | { 162 | "name": "symfony/var-dumper", 163 | "version": "6.4.x-dev", 164 | "source": { 165 | "type": "git", 166 | "url": "https://github.com/symfony/var-dumper.git", 167 | "reference": "c40f7d17e91d8b407582ed51a2bbf83c52c367f6" 168 | }, 169 | "dist": { 170 | "type": "zip", 171 | "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c40f7d17e91d8b407582ed51a2bbf83c52c367f6", 172 | "reference": "c40f7d17e91d8b407582ed51a2bbf83c52c367f6", 173 | "shasum": "" 174 | }, 175 | "require": { 176 | "php": ">=8.1", 177 | "symfony/deprecation-contracts": "^2.5|^3", 178 | "symfony/polyfill-mbstring": "~1.0" 179 | }, 180 | "conflict": { 181 | "symfony/console": "<5.4" 182 | }, 183 | "require-dev": { 184 | "ext-iconv": "*", 185 | "symfony/console": "^5.4|^6.0|^7.0", 186 | "symfony/error-handler": "^6.3|^7.0", 187 | "symfony/http-kernel": "^5.4|^6.0|^7.0", 188 | "symfony/process": "^5.4|^6.0|^7.0", 189 | "symfony/uid": "^5.4|^6.0|^7.0", 190 | "twig/twig": "^2.13|^3.0.4" 191 | }, 192 | "bin": [ 193 | "Resources/bin/var-dump-server" 194 | ], 195 | "type": "library", 196 | "autoload": { 197 | "files": [ 198 | "Resources/functions/dump.php" 199 | ], 200 | "psr-4": { 201 | "Symfony\\Component\\VarDumper\\": "" 202 | }, 203 | "exclude-from-classmap": [ 204 | "/Tests/" 205 | ] 206 | }, 207 | "notification-url": "https://packagist.org/downloads/", 208 | "license": [ 209 | "MIT" 210 | ], 211 | "authors": [ 212 | { 213 | "name": "Nicolas Grekas", 214 | "email": "p@tchwork.com" 215 | }, 216 | { 217 | "name": "Symfony Community", 218 | "homepage": "https://symfony.com/contributors" 219 | } 220 | ], 221 | "description": "Provides mechanisms for walking through any arbitrary PHP variable", 222 | "homepage": "https://symfony.com", 223 | "keywords": [ 224 | "debug", 225 | "dump" 226 | ], 227 | "support": { 228 | "source": "https://github.com/symfony/var-dumper/tree/6.4" 229 | }, 230 | "funding": [ 231 | { 232 | "url": "https://symfony.com/sponsor", 233 | "type": "custom" 234 | }, 235 | { 236 | "url": "https://github.com/fabpot", 237 | "type": "github" 238 | }, 239 | { 240 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 241 | "type": "tidelift" 242 | } 243 | ], 244 | "time": "2023-11-09T08:28:32+00:00" 245 | } 246 | ], 247 | "packages-dev": [ 248 | { 249 | "name": "carbonphp/carbon-doctrine-types", 250 | "version": "dev-main", 251 | "source": { 252 | "type": "git", 253 | "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", 254 | "reference": "49856fbc09fe91b5433381faec60e3620ad364ad" 255 | }, 256 | "dist": { 257 | "type": "zip", 258 | "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/49856fbc09fe91b5433381faec60e3620ad364ad", 259 | "reference": "49856fbc09fe91b5433381faec60e3620ad364ad", 260 | "shasum": "" 261 | }, 262 | "require": { 263 | "php": "^8.1" 264 | }, 265 | "conflict": { 266 | "doctrine/dbal": "<4.0.0 || >=5.0.0" 267 | }, 268 | "require-dev": { 269 | "doctrine/dbal": "^4.0.0", 270 | "nesbot/carbon": "^2.71.0 || ^3.0.0", 271 | "phpunit/phpunit": "^10.3" 272 | }, 273 | "default-branch": true, 274 | "type": "library", 275 | "autoload": { 276 | "psr-4": { 277 | "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" 278 | } 279 | }, 280 | "notification-url": "https://packagist.org/downloads/", 281 | "license": [ 282 | "MIT" 283 | ], 284 | "authors": [ 285 | { 286 | "name": "KyleKatarn", 287 | "email": "kylekatarnls@gmail.com" 288 | } 289 | ], 290 | "description": "Types to use Carbon in Doctrine", 291 | "keywords": [ 292 | "carbon", 293 | "date", 294 | "datetime", 295 | "doctrine", 296 | "time" 297 | ], 298 | "support": { 299 | "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", 300 | "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.0.0" 301 | }, 302 | "funding": [ 303 | { 304 | "url": "https://github.com/kylekatarnls", 305 | "type": "github" 306 | }, 307 | { 308 | "url": "https://opencollective.com/Carbon", 309 | "type": "open_collective" 310 | }, 311 | { 312 | "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", 313 | "type": "tidelift" 314 | } 315 | ], 316 | "time": "2023-10-01T14:36:55+00:00" 317 | }, 318 | { 319 | "name": "doctrine/inflector", 320 | "version": "2.1.x-dev", 321 | "source": { 322 | "type": "git", 323 | "url": "https://github.com/doctrine/inflector.git", 324 | "reference": "d62dadcaaf16432c7c1364bf50be9e03f26ff043" 325 | }, 326 | "dist": { 327 | "type": "zip", 328 | "url": "https://api.github.com/repos/doctrine/inflector/zipball/d62dadcaaf16432c7c1364bf50be9e03f26ff043", 329 | "reference": "d62dadcaaf16432c7c1364bf50be9e03f26ff043", 330 | "shasum": "" 331 | }, 332 | "require": { 333 | "php": "^7.2 || ^8.0" 334 | }, 335 | "require-dev": { 336 | "doctrine/coding-standard": "^11.0", 337 | "phpstan/phpstan": "^1.8", 338 | "phpstan/phpstan-phpunit": "^1.1", 339 | "phpstan/phpstan-strict-rules": "^1.3", 340 | "phpunit/phpunit": "^8.5 || ^9.5", 341 | "vimeo/psalm": "^4.25 || ^5.4" 342 | }, 343 | "type": "library", 344 | "autoload": { 345 | "psr-4": { 346 | "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" 347 | } 348 | }, 349 | "notification-url": "https://packagist.org/downloads/", 350 | "license": [ 351 | "MIT" 352 | ], 353 | "authors": [ 354 | { 355 | "name": "Guilherme Blanco", 356 | "email": "guilhermeblanco@gmail.com" 357 | }, 358 | { 359 | "name": "Roman Borschel", 360 | "email": "roman@code-factory.org" 361 | }, 362 | { 363 | "name": "Benjamin Eberlei", 364 | "email": "kontakt@beberlei.de" 365 | }, 366 | { 367 | "name": "Jonathan Wage", 368 | "email": "jonwage@gmail.com" 369 | }, 370 | { 371 | "name": "Johannes Schmitt", 372 | "email": "schmittjoh@gmail.com" 373 | } 374 | ], 375 | "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", 376 | "homepage": "https://www.doctrine-project.org/projects/inflector.html", 377 | "keywords": [ 378 | "inflection", 379 | "inflector", 380 | "lowercase", 381 | "manipulation", 382 | "php", 383 | "plural", 384 | "singular", 385 | "strings", 386 | "uppercase", 387 | "words" 388 | ], 389 | "support": { 390 | "issues": "https://github.com/doctrine/inflector/issues", 391 | "source": "https://github.com/doctrine/inflector/tree/2.1.x" 392 | }, 393 | "funding": [ 394 | { 395 | "url": "https://www.doctrine-project.org/sponsorship.html", 396 | "type": "custom" 397 | }, 398 | { 399 | "url": "https://www.patreon.com/phpdoctrine", 400 | "type": "patreon" 401 | }, 402 | { 403 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", 404 | "type": "tidelift" 405 | } 406 | ], 407 | "time": "2023-06-16T13:41:28+00:00" 408 | }, 409 | { 410 | "name": "illuminate/collections", 411 | "version": "10.x-dev", 412 | "source": { 413 | "type": "git", 414 | "url": "https://github.com/illuminate/collections.git", 415 | "reference": "8e4c4f97ea066cd6aec962ef8a6abc09dfd5e754" 416 | }, 417 | "dist": { 418 | "type": "zip", 419 | "url": "https://api.github.com/repos/illuminate/collections/zipball/8e4c4f97ea066cd6aec962ef8a6abc09dfd5e754", 420 | "reference": "8e4c4f97ea066cd6aec962ef8a6abc09dfd5e754", 421 | "shasum": "" 422 | }, 423 | "require": { 424 | "illuminate/conditionable": "^10.0", 425 | "illuminate/contracts": "^10.0", 426 | "illuminate/macroable": "^10.0", 427 | "php": "^8.1" 428 | }, 429 | "suggest": { 430 | "symfony/var-dumper": "Required to use the dump method (^6.2)." 431 | }, 432 | "type": "library", 433 | "extra": { 434 | "branch-alias": { 435 | "dev-master": "10.x-dev" 436 | } 437 | }, 438 | "autoload": { 439 | "files": [ 440 | "helpers.php" 441 | ], 442 | "psr-4": { 443 | "Illuminate\\Support\\": "" 444 | } 445 | }, 446 | "notification-url": "https://packagist.org/downloads/", 447 | "license": [ 448 | "MIT" 449 | ], 450 | "authors": [ 451 | { 452 | "name": "Taylor Otwell", 453 | "email": "taylor@laravel.com" 454 | } 455 | ], 456 | "description": "The Illuminate Collections package.", 457 | "homepage": "https://laravel.com", 458 | "support": { 459 | "issues": "https://github.com/laravel/framework/issues", 460 | "source": "https://github.com/laravel/framework" 461 | }, 462 | "time": "2023-11-27T14:46:52+00:00" 463 | }, 464 | { 465 | "name": "illuminate/conditionable", 466 | "version": "10.x-dev", 467 | "source": { 468 | "type": "git", 469 | "url": "https://github.com/illuminate/conditionable.git", 470 | "reference": "d0958e4741fc9d6f516a552060fd1b829a85e009" 471 | }, 472 | "dist": { 473 | "type": "zip", 474 | "url": "https://api.github.com/repos/illuminate/conditionable/zipball/d0958e4741fc9d6f516a552060fd1b829a85e009", 475 | "reference": "d0958e4741fc9d6f516a552060fd1b829a85e009", 476 | "shasum": "" 477 | }, 478 | "require": { 479 | "php": "^8.0.2" 480 | }, 481 | "type": "library", 482 | "extra": { 483 | "branch-alias": { 484 | "dev-master": "10.x-dev" 485 | } 486 | }, 487 | "autoload": { 488 | "psr-4": { 489 | "Illuminate\\Support\\": "" 490 | } 491 | }, 492 | "notification-url": "https://packagist.org/downloads/", 493 | "license": [ 494 | "MIT" 495 | ], 496 | "authors": [ 497 | { 498 | "name": "Taylor Otwell", 499 | "email": "taylor@laravel.com" 500 | } 501 | ], 502 | "description": "The Illuminate Conditionable package.", 503 | "homepage": "https://laravel.com", 504 | "support": { 505 | "issues": "https://github.com/laravel/framework/issues", 506 | "source": "https://github.com/laravel/framework" 507 | }, 508 | "time": "2023-02-03T08:06:17+00:00" 509 | }, 510 | { 511 | "name": "illuminate/contracts", 512 | "version": "10.x-dev", 513 | "source": { 514 | "type": "git", 515 | "url": "https://github.com/illuminate/contracts.git", 516 | "reference": "f6bf37a272fda164f6c451407c99f820eb1eb95b" 517 | }, 518 | "dist": { 519 | "type": "zip", 520 | "url": "https://api.github.com/repos/illuminate/contracts/zipball/f6bf37a272fda164f6c451407c99f820eb1eb95b", 521 | "reference": "f6bf37a272fda164f6c451407c99f820eb1eb95b", 522 | "shasum": "" 523 | }, 524 | "require": { 525 | "php": "^8.1", 526 | "psr/container": "^1.1.1|^2.0.1", 527 | "psr/simple-cache": "^1.0|^2.0|^3.0" 528 | }, 529 | "type": "library", 530 | "extra": { 531 | "branch-alias": { 532 | "dev-master": "10.x-dev" 533 | } 534 | }, 535 | "autoload": { 536 | "psr-4": { 537 | "Illuminate\\Contracts\\": "" 538 | } 539 | }, 540 | "notification-url": "https://packagist.org/downloads/", 541 | "license": [ 542 | "MIT" 543 | ], 544 | "authors": [ 545 | { 546 | "name": "Taylor Otwell", 547 | "email": "taylor@laravel.com" 548 | } 549 | ], 550 | "description": "The Illuminate Contracts package.", 551 | "homepage": "https://laravel.com", 552 | "support": { 553 | "issues": "https://github.com/laravel/framework/issues", 554 | "source": "https://github.com/laravel/framework" 555 | }, 556 | "time": "2023-10-30T00:59:22+00:00" 557 | }, 558 | { 559 | "name": "illuminate/macroable", 560 | "version": "10.x-dev", 561 | "source": { 562 | "type": "git", 563 | "url": "https://github.com/illuminate/macroable.git", 564 | "reference": "dff667a46ac37b634dcf68909d9d41e94dc97c27" 565 | }, 566 | "dist": { 567 | "type": "zip", 568 | "url": "https://api.github.com/repos/illuminate/macroable/zipball/dff667a46ac37b634dcf68909d9d41e94dc97c27", 569 | "reference": "dff667a46ac37b634dcf68909d9d41e94dc97c27", 570 | "shasum": "" 571 | }, 572 | "require": { 573 | "php": "^8.1" 574 | }, 575 | "type": "library", 576 | "extra": { 577 | "branch-alias": { 578 | "dev-master": "10.x-dev" 579 | } 580 | }, 581 | "autoload": { 582 | "psr-4": { 583 | "Illuminate\\Support\\": "" 584 | } 585 | }, 586 | "notification-url": "https://packagist.org/downloads/", 587 | "license": [ 588 | "MIT" 589 | ], 590 | "authors": [ 591 | { 592 | "name": "Taylor Otwell", 593 | "email": "taylor@laravel.com" 594 | } 595 | ], 596 | "description": "The Illuminate Macroable package.", 597 | "homepage": "https://laravel.com", 598 | "support": { 599 | "issues": "https://github.com/laravel/framework/issues", 600 | "source": "https://github.com/laravel/framework" 601 | }, 602 | "time": "2023-06-05T12:46:42+00:00" 603 | }, 604 | { 605 | "name": "illuminate/support", 606 | "version": "10.x-dev", 607 | "source": { 608 | "type": "git", 609 | "url": "https://github.com/illuminate/support.git", 610 | "reference": "4eeecb17a5a798556b573843e8964faaf7dba290" 611 | }, 612 | "dist": { 613 | "type": "zip", 614 | "url": "https://api.github.com/repos/illuminate/support/zipball/4eeecb17a5a798556b573843e8964faaf7dba290", 615 | "reference": "4eeecb17a5a798556b573843e8964faaf7dba290", 616 | "shasum": "" 617 | }, 618 | "require": { 619 | "doctrine/inflector": "^2.0", 620 | "ext-ctype": "*", 621 | "ext-filter": "*", 622 | "ext-mbstring": "*", 623 | "illuminate/collections": "^10.0", 624 | "illuminate/conditionable": "^10.0", 625 | "illuminate/contracts": "^10.0", 626 | "illuminate/macroable": "^10.0", 627 | "nesbot/carbon": "^2.67", 628 | "php": "^8.1", 629 | "voku/portable-ascii": "^2.0" 630 | }, 631 | "conflict": { 632 | "tightenco/collect": "<5.5.33" 633 | }, 634 | "suggest": { 635 | "illuminate/filesystem": "Required to use the composer class (^10.0).", 636 | "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", 637 | "ramsey/uuid": "Required to use Str::uuid() (^4.7).", 638 | "symfony/process": "Required to use the composer class (^6.2).", 639 | "symfony/uid": "Required to use Str::ulid() (^6.2).", 640 | "symfony/var-dumper": "Required to use the dd function (^6.2).", 641 | "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." 642 | }, 643 | "type": "library", 644 | "extra": { 645 | "branch-alias": { 646 | "dev-master": "10.x-dev" 647 | } 648 | }, 649 | "autoload": { 650 | "files": [ 651 | "helpers.php" 652 | ], 653 | "psr-4": { 654 | "Illuminate\\Support\\": "" 655 | } 656 | }, 657 | "notification-url": "https://packagist.org/downloads/", 658 | "license": [ 659 | "MIT" 660 | ], 661 | "authors": [ 662 | { 663 | "name": "Taylor Otwell", 664 | "email": "taylor@laravel.com" 665 | } 666 | ], 667 | "description": "The Illuminate Support package.", 668 | "homepage": "https://laravel.com", 669 | "support": { 670 | "issues": "https://github.com/laravel/framework/issues", 671 | "source": "https://github.com/laravel/framework" 672 | }, 673 | "time": "2023-11-30T22:33:19+00:00" 674 | }, 675 | { 676 | "name": "nesbot/carbon", 677 | "version": "dev-master", 678 | "source": { 679 | "type": "git", 680 | "url": "https://github.com/briannesbitt/Carbon.git", 681 | "reference": "87baf0e6ff475f2add18a9f5f839ea0a8178f533" 682 | }, 683 | "dist": { 684 | "type": "zip", 685 | "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/87baf0e6ff475f2add18a9f5f839ea0a8178f533", 686 | "reference": "87baf0e6ff475f2add18a9f5f839ea0a8178f533", 687 | "shasum": "" 688 | }, 689 | "require": { 690 | "carbonphp/carbon-doctrine-types": "*", 691 | "ext-json": "*", 692 | "php": "^7.1.8 || ^8.0", 693 | "psr/clock": "^1.0", 694 | "symfony/polyfill-mbstring": "^1.0", 695 | "symfony/polyfill-php80": "^1.16", 696 | "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" 697 | }, 698 | "provide": { 699 | "psr/clock-implementation": "1.0" 700 | }, 701 | "require-dev": { 702 | "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", 703 | "doctrine/orm": "^2.7 || ^3.0", 704 | "friendsofphp/php-cs-fixer": "^3.0", 705 | "kylekatarnls/multi-tester": "^2.0", 706 | "ondrejmirtes/better-reflection": "*", 707 | "phpmd/phpmd": "^2.9", 708 | "phpstan/extension-installer": "^1.0", 709 | "phpstan/phpstan": "^0.12.99 || ^1.7.14", 710 | "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", 711 | "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", 712 | "squizlabs/php_codesniffer": "^3.4" 713 | }, 714 | "default-branch": true, 715 | "bin": [ 716 | "bin/carbon" 717 | ], 718 | "type": "library", 719 | "extra": { 720 | "branch-alias": { 721 | "dev-3.x": "3.x-dev", 722 | "dev-master": "2.x-dev" 723 | }, 724 | "laravel": { 725 | "providers": [ 726 | "Carbon\\Laravel\\ServiceProvider" 727 | ] 728 | }, 729 | "phpstan": { 730 | "includes": [ 731 | "extension.neon" 732 | ] 733 | } 734 | }, 735 | "autoload": { 736 | "psr-4": { 737 | "Carbon\\": "src/Carbon/" 738 | } 739 | }, 740 | "notification-url": "https://packagist.org/downloads/", 741 | "license": [ 742 | "MIT" 743 | ], 744 | "authors": [ 745 | { 746 | "name": "Brian Nesbitt", 747 | "email": "brian@nesbot.com", 748 | "homepage": "https://markido.com" 749 | }, 750 | { 751 | "name": "kylekatarnls", 752 | "homepage": "https://github.com/kylekatarnls" 753 | } 754 | ], 755 | "description": "An API extension for DateTime that supports 281 different languages.", 756 | "homepage": "https://carbon.nesbot.com", 757 | "keywords": [ 758 | "date", 759 | "datetime", 760 | "time" 761 | ], 762 | "support": { 763 | "docs": "https://carbon.nesbot.com/docs", 764 | "issues": "https://github.com/briannesbitt/Carbon/issues", 765 | "source": "https://github.com/briannesbitt/Carbon" 766 | }, 767 | "funding": [ 768 | { 769 | "url": "https://github.com/sponsors/kylekatarnls", 770 | "type": "github" 771 | }, 772 | { 773 | "url": "https://opencollective.com/Carbon#sponsor", 774 | "type": "opencollective" 775 | }, 776 | { 777 | "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", 778 | "type": "tidelift" 779 | } 780 | ], 781 | "time": "2023-12-01T22:30:17+00:00" 782 | }, 783 | { 784 | "name": "psr/clock", 785 | "version": "1.0.0", 786 | "source": { 787 | "type": "git", 788 | "url": "https://github.com/php-fig/clock.git", 789 | "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" 790 | }, 791 | "dist": { 792 | "type": "zip", 793 | "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", 794 | "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", 795 | "shasum": "" 796 | }, 797 | "require": { 798 | "php": "^7.0 || ^8.0" 799 | }, 800 | "type": "library", 801 | "autoload": { 802 | "psr-4": { 803 | "Psr\\Clock\\": "src/" 804 | } 805 | }, 806 | "notification-url": "https://packagist.org/downloads/", 807 | "license": [ 808 | "MIT" 809 | ], 810 | "authors": [ 811 | { 812 | "name": "PHP-FIG", 813 | "homepage": "https://www.php-fig.org/" 814 | } 815 | ], 816 | "description": "Common interface for reading the clock.", 817 | "homepage": "https://github.com/php-fig/clock", 818 | "keywords": [ 819 | "clock", 820 | "now", 821 | "psr", 822 | "psr-20", 823 | "time" 824 | ], 825 | "support": { 826 | "issues": "https://github.com/php-fig/clock/issues", 827 | "source": "https://github.com/php-fig/clock/tree/1.0.0" 828 | }, 829 | "time": "2022-11-25T14:36:26+00:00" 830 | }, 831 | { 832 | "name": "psr/container", 833 | "version": "dev-master", 834 | "source": { 835 | "type": "git", 836 | "url": "https://github.com/php-fig/container.git", 837 | "reference": "707984727bd5b2b670e59559d3ed2500240cf875" 838 | }, 839 | "dist": { 840 | "type": "zip", 841 | "url": "https://api.github.com/repos/php-fig/container/zipball/707984727bd5b2b670e59559d3ed2500240cf875", 842 | "reference": "707984727bd5b2b670e59559d3ed2500240cf875", 843 | "shasum": "" 844 | }, 845 | "require": { 846 | "php": ">=7.4.0" 847 | }, 848 | "default-branch": true, 849 | "type": "library", 850 | "extra": { 851 | "branch-alias": { 852 | "dev-master": "2.0.x-dev" 853 | } 854 | }, 855 | "autoload": { 856 | "psr-4": { 857 | "Psr\\Container\\": "src/" 858 | } 859 | }, 860 | "notification-url": "https://packagist.org/downloads/", 861 | "license": [ 862 | "MIT" 863 | ], 864 | "authors": [ 865 | { 866 | "name": "PHP-FIG", 867 | "homepage": "https://www.php-fig.org/" 868 | } 869 | ], 870 | "description": "Common Container Interface (PHP FIG PSR-11)", 871 | "homepage": "https://github.com/php-fig/container", 872 | "keywords": [ 873 | "PSR-11", 874 | "container", 875 | "container-interface", 876 | "container-interop", 877 | "psr" 878 | ], 879 | "support": { 880 | "issues": "https://github.com/php-fig/container/issues", 881 | "source": "https://github.com/php-fig/container" 882 | }, 883 | "time": "2023-09-22T11:11:30+00:00" 884 | }, 885 | { 886 | "name": "psr/simple-cache", 887 | "version": "dev-master", 888 | "source": { 889 | "type": "git", 890 | "url": "https://github.com/php-fig/simple-cache.git", 891 | "reference": "2d280c2aaa23a120f35d55cfde8581954a8e77fa" 892 | }, 893 | "dist": { 894 | "type": "zip", 895 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/2d280c2aaa23a120f35d55cfde8581954a8e77fa", 896 | "reference": "2d280c2aaa23a120f35d55cfde8581954a8e77fa", 897 | "shasum": "" 898 | }, 899 | "require": { 900 | "php": ">=8.0.0" 901 | }, 902 | "default-branch": true, 903 | "type": "library", 904 | "extra": { 905 | "branch-alias": { 906 | "dev-master": "3.0.x-dev" 907 | } 908 | }, 909 | "autoload": { 910 | "psr-4": { 911 | "Psr\\SimpleCache\\": "src/" 912 | } 913 | }, 914 | "notification-url": "https://packagist.org/downloads/", 915 | "license": [ 916 | "MIT" 917 | ], 918 | "authors": [ 919 | { 920 | "name": "PHP-FIG", 921 | "homepage": "https://www.php-fig.org/" 922 | } 923 | ], 924 | "description": "Common interfaces for simple caching", 925 | "keywords": [ 926 | "cache", 927 | "caching", 928 | "psr", 929 | "psr-16", 930 | "simple-cache" 931 | ], 932 | "support": { 933 | "source": "https://github.com/php-fig/simple-cache/tree/master" 934 | }, 935 | "time": "2022-04-08T16:41:45+00:00" 936 | }, 937 | { 938 | "name": "symfony/polyfill-php80", 939 | "version": "1.x-dev", 940 | "source": { 941 | "type": "git", 942 | "url": "https://github.com/symfony/polyfill-php80.git", 943 | "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" 944 | }, 945 | "dist": { 946 | "type": "zip", 947 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", 948 | "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", 949 | "shasum": "" 950 | }, 951 | "require": { 952 | "php": ">=7.1" 953 | }, 954 | "default-branch": true, 955 | "type": "library", 956 | "extra": { 957 | "branch-alias": { 958 | "dev-main": "1.28-dev" 959 | }, 960 | "thanks": { 961 | "name": "symfony/polyfill", 962 | "url": "https://github.com/symfony/polyfill" 963 | } 964 | }, 965 | "autoload": { 966 | "files": [ 967 | "bootstrap.php" 968 | ], 969 | "psr-4": { 970 | "Symfony\\Polyfill\\Php80\\": "" 971 | }, 972 | "classmap": [ 973 | "Resources/stubs" 974 | ] 975 | }, 976 | "notification-url": "https://packagist.org/downloads/", 977 | "license": [ 978 | "MIT" 979 | ], 980 | "authors": [ 981 | { 982 | "name": "Ion Bazan", 983 | "email": "ion.bazan@gmail.com" 984 | }, 985 | { 986 | "name": "Nicolas Grekas", 987 | "email": "p@tchwork.com" 988 | }, 989 | { 990 | "name": "Symfony Community", 991 | "homepage": "https://symfony.com/contributors" 992 | } 993 | ], 994 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 995 | "homepage": "https://symfony.com", 996 | "keywords": [ 997 | "compatibility", 998 | "polyfill", 999 | "portable", 1000 | "shim" 1001 | ], 1002 | "support": { 1003 | "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" 1004 | }, 1005 | "funding": [ 1006 | { 1007 | "url": "https://symfony.com/sponsor", 1008 | "type": "custom" 1009 | }, 1010 | { 1011 | "url": "https://github.com/fabpot", 1012 | "type": "github" 1013 | }, 1014 | { 1015 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1016 | "type": "tidelift" 1017 | } 1018 | ], 1019 | "time": "2023-01-26T09:26:14+00:00" 1020 | }, 1021 | { 1022 | "name": "symfony/translation", 1023 | "version": "6.4.x-dev", 1024 | "source": { 1025 | "type": "git", 1026 | "url": "https://github.com/symfony/translation.git", 1027 | "reference": "b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37" 1028 | }, 1029 | "dist": { 1030 | "type": "zip", 1031 | "url": "https://api.github.com/repos/symfony/translation/zipball/b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37", 1032 | "reference": "b1035dbc2a344b21f8fa8ac451c7ecec4ea45f37", 1033 | "shasum": "" 1034 | }, 1035 | "require": { 1036 | "php": ">=8.1", 1037 | "symfony/deprecation-contracts": "^2.5|^3", 1038 | "symfony/polyfill-mbstring": "~1.0", 1039 | "symfony/translation-contracts": "^2.5|^3.0" 1040 | }, 1041 | "conflict": { 1042 | "symfony/config": "<5.4", 1043 | "symfony/console": "<5.4", 1044 | "symfony/dependency-injection": "<5.4", 1045 | "symfony/http-client-contracts": "<2.5", 1046 | "symfony/http-kernel": "<5.4", 1047 | "symfony/service-contracts": "<2.5", 1048 | "symfony/twig-bundle": "<5.4", 1049 | "symfony/yaml": "<5.4" 1050 | }, 1051 | "provide": { 1052 | "symfony/translation-implementation": "2.3|3.0" 1053 | }, 1054 | "require-dev": { 1055 | "nikic/php-parser": "^4.13", 1056 | "psr/log": "^1|^2|^3", 1057 | "symfony/config": "^5.4|^6.0|^7.0", 1058 | "symfony/console": "^5.4|^6.0|^7.0", 1059 | "symfony/dependency-injection": "^5.4|^6.0|^7.0", 1060 | "symfony/finder": "^5.4|^6.0|^7.0", 1061 | "symfony/http-client-contracts": "^2.5|^3.0", 1062 | "symfony/http-kernel": "^5.4|^6.0|^7.0", 1063 | "symfony/intl": "^5.4|^6.0|^7.0", 1064 | "symfony/polyfill-intl-icu": "^1.21", 1065 | "symfony/routing": "^5.4|^6.0|^7.0", 1066 | "symfony/service-contracts": "^2.5|^3", 1067 | "symfony/yaml": "^5.4|^6.0|^7.0" 1068 | }, 1069 | "type": "library", 1070 | "autoload": { 1071 | "files": [ 1072 | "Resources/functions.php" 1073 | ], 1074 | "psr-4": { 1075 | "Symfony\\Component\\Translation\\": "" 1076 | }, 1077 | "exclude-from-classmap": [ 1078 | "/Tests/" 1079 | ] 1080 | }, 1081 | "notification-url": "https://packagist.org/downloads/", 1082 | "license": [ 1083 | "MIT" 1084 | ], 1085 | "authors": [ 1086 | { 1087 | "name": "Fabien Potencier", 1088 | "email": "fabien@symfony.com" 1089 | }, 1090 | { 1091 | "name": "Symfony Community", 1092 | "homepage": "https://symfony.com/contributors" 1093 | } 1094 | ], 1095 | "description": "Provides tools to internationalize your application", 1096 | "homepage": "https://symfony.com", 1097 | "support": { 1098 | "source": "https://github.com/symfony/translation/tree/6.4" 1099 | }, 1100 | "funding": [ 1101 | { 1102 | "url": "https://symfony.com/sponsor", 1103 | "type": "custom" 1104 | }, 1105 | { 1106 | "url": "https://github.com/fabpot", 1107 | "type": "github" 1108 | }, 1109 | { 1110 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1111 | "type": "tidelift" 1112 | } 1113 | ], 1114 | "time": "2023-11-29T08:14:36+00:00" 1115 | }, 1116 | { 1117 | "name": "symfony/translation-contracts", 1118 | "version": "dev-main", 1119 | "source": { 1120 | "type": "git", 1121 | "url": "https://github.com/symfony/translation-contracts.git", 1122 | "reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5" 1123 | }, 1124 | "dist": { 1125 | "type": "zip", 1126 | "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dee0c6e5b4c07ce851b462530088e64b255ac9c5", 1127 | "reference": "dee0c6e5b4c07ce851b462530088e64b255ac9c5", 1128 | "shasum": "" 1129 | }, 1130 | "require": { 1131 | "php": ">=8.1" 1132 | }, 1133 | "default-branch": true, 1134 | "type": "library", 1135 | "extra": { 1136 | "branch-alias": { 1137 | "dev-main": "3.4-dev" 1138 | }, 1139 | "thanks": { 1140 | "name": "symfony/contracts", 1141 | "url": "https://github.com/symfony/contracts" 1142 | } 1143 | }, 1144 | "autoload": { 1145 | "psr-4": { 1146 | "Symfony\\Contracts\\Translation\\": "" 1147 | }, 1148 | "exclude-from-classmap": [ 1149 | "/Test/" 1150 | ] 1151 | }, 1152 | "notification-url": "https://packagist.org/downloads/", 1153 | "license": [ 1154 | "MIT" 1155 | ], 1156 | "authors": [ 1157 | { 1158 | "name": "Nicolas Grekas", 1159 | "email": "p@tchwork.com" 1160 | }, 1161 | { 1162 | "name": "Symfony Community", 1163 | "homepage": "https://symfony.com/contributors" 1164 | } 1165 | ], 1166 | "description": "Generic abstractions related to translation", 1167 | "homepage": "https://symfony.com", 1168 | "keywords": [ 1169 | "abstractions", 1170 | "contracts", 1171 | "decoupling", 1172 | "interfaces", 1173 | "interoperability", 1174 | "standards" 1175 | ], 1176 | "support": { 1177 | "source": "https://github.com/symfony/translation-contracts/tree/v3.4.0" 1178 | }, 1179 | "funding": [ 1180 | { 1181 | "url": "https://symfony.com/sponsor", 1182 | "type": "custom" 1183 | }, 1184 | { 1185 | "url": "https://github.com/fabpot", 1186 | "type": "github" 1187 | }, 1188 | { 1189 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1190 | "type": "tidelift" 1191 | } 1192 | ], 1193 | "time": "2023-07-25T15:08:44+00:00" 1194 | }, 1195 | { 1196 | "name": "voku/portable-ascii", 1197 | "version": "2.0.1", 1198 | "source": { 1199 | "type": "git", 1200 | "url": "https://github.com/voku/portable-ascii.git", 1201 | "reference": "b56450eed252f6801410d810c8e1727224ae0743" 1202 | }, 1203 | "dist": { 1204 | "type": "zip", 1205 | "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", 1206 | "reference": "b56450eed252f6801410d810c8e1727224ae0743", 1207 | "shasum": "" 1208 | }, 1209 | "require": { 1210 | "php": ">=7.0.0" 1211 | }, 1212 | "require-dev": { 1213 | "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" 1214 | }, 1215 | "suggest": { 1216 | "ext-intl": "Use Intl for transliterator_transliterate() support" 1217 | }, 1218 | "type": "library", 1219 | "autoload": { 1220 | "psr-4": { 1221 | "voku\\": "src/voku/" 1222 | } 1223 | }, 1224 | "notification-url": "https://packagist.org/downloads/", 1225 | "license": [ 1226 | "MIT" 1227 | ], 1228 | "authors": [ 1229 | { 1230 | "name": "Lars Moelleken", 1231 | "homepage": "http://www.moelleken.org/" 1232 | } 1233 | ], 1234 | "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", 1235 | "homepage": "https://github.com/voku/portable-ascii", 1236 | "keywords": [ 1237 | "ascii", 1238 | "clean", 1239 | "php" 1240 | ], 1241 | "support": { 1242 | "issues": "https://github.com/voku/portable-ascii/issues", 1243 | "source": "https://github.com/voku/portable-ascii/tree/2.0.1" 1244 | }, 1245 | "funding": [ 1246 | { 1247 | "url": "https://www.paypal.me/moelleken", 1248 | "type": "custom" 1249 | }, 1250 | { 1251 | "url": "https://github.com/voku", 1252 | "type": "github" 1253 | }, 1254 | { 1255 | "url": "https://opencollective.com/portable-ascii", 1256 | "type": "open_collective" 1257 | }, 1258 | { 1259 | "url": "https://www.patreon.com/voku", 1260 | "type": "patreon" 1261 | }, 1262 | { 1263 | "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", 1264 | "type": "tidelift" 1265 | } 1266 | ], 1267 | "time": "2022-03-08T17:03:00+00:00" 1268 | } 1269 | ], 1270 | "aliases": [], 1271 | "minimum-stability": "dev", 1272 | "stability-flags": [], 1273 | "prefer-stable": false, 1274 | "prefer-lowest": false, 1275 | "platform": { 1276 | "php": "^8.1", 1277 | "ext-curl": "*", 1278 | "ext-json": "*" 1279 | }, 1280 | "platform-dev": [], 1281 | "plugin-api-version": "2.3.0" 1282 | } 1283 | -------------------------------------------------------------------------------- /logdesk-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jhonoryza/laravel-logdesk/29f54a2f9490914e8818659990384748eaaddb7b/logdesk-2.png -------------------------------------------------------------------------------- /src/Client.php: -------------------------------------------------------------------------------- 1 | fingerprint = $host . ':' . $portNumber; 24 | 25 | $this->portNumber = $portNumber; 26 | 27 | $this->host = $host; 28 | } 29 | 30 | public function __destruct() 31 | { 32 | if ($this->curlHandle) { 33 | curl_close($this->curlHandle); 34 | $this->curlHandle = null; 35 | } 36 | } 37 | 38 | public function serverIsAvailable(): bool 39 | { 40 | // purge expired entries from the cache 41 | static::$cache = array_filter(static::$cache, function ($data) { 42 | return microtime(true) < $data[1]; 43 | }); 44 | 45 | if (! isset(static::$cache[$this->fingerprint])) { 46 | $this->performAvailabilityCheck(); 47 | } 48 | 49 | return static::$cache[$this->fingerprint][0] ?? true; 50 | } 51 | 52 | public function performAvailabilityCheck(): bool 53 | { 54 | try { 55 | $curlHandle = $this->getCurlHandleForUrl('get', '_availability_check'); 56 | 57 | curl_exec($curlHandle); 58 | //dd(curl_errno($curlHandle)); 59 | 60 | $success = curl_errno($curlHandle) === CURLE_HTTP_NOT_FOUND; 61 | 62 | // expire the cache entry after 30 sec 63 | $expiresAt = microtime(true) + 30.0; 64 | 65 | static::$cache[$this->fingerprint] = [$success, $expiresAt]; 66 | } finally { 67 | return $success ?? false; 68 | } 69 | } 70 | 71 | public function send(Request $request): void 72 | { 73 | if (! $this->serverIsAvailable()) { 74 | return; 75 | } 76 | 77 | $curlHandle = $this->getCurlHandleForUrl('post', 'api/echo'); 78 | 79 | $curlError = null; 80 | 81 | curl_setopt($this->curlHandle, CURLOPT_POSTFIELDS, $request->toJson()); 82 | curl_exec($curlHandle); 83 | 84 | if (curl_errno($curlHandle)) { 85 | $curlError = curl_error($curlHandle); 86 | } 87 | 88 | if ($curlError) { 89 | // do nothing for now 90 | } 91 | } 92 | 93 | protected function getCurlHandleForUrl(string $method, string $url) 94 | { 95 | return $this->getCurlHandle($method, "http://{$this->host}:{$this->portNumber}/{$url}"); 96 | } 97 | 98 | protected function getCurlHandle(string $method, string $fullUrl) 99 | { 100 | if (! $this->curlHandle) { 101 | $this->curlHandle = curl_init(); 102 | } 103 | 104 | curl_reset($this->curlHandle); 105 | curl_setopt($this->curlHandle, CURLOPT_URL, $fullUrl); 106 | 107 | curl_setopt($this->curlHandle, CURLOPT_HTTPHEADER, array_merge([ 108 | 'Accept: application/json', 109 | 'Content-Type: application/json', 110 | ])); 111 | 112 | curl_setopt($this->curlHandle, CURLOPT_USERAGENT, 'Ray 1.0'); 113 | curl_setopt($this->curlHandle, CURLOPT_RETURNTRANSFER, true); 114 | curl_setopt($this->curlHandle, CURLOPT_TIMEOUT, 2); 115 | curl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYPEER, true); 116 | curl_setopt($this->curlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 117 | curl_setopt($this->curlHandle, CURLOPT_ENCODING, ''); 118 | curl_setopt($this->curlHandle, CURLINFO_HEADER_OUT, true); 119 | curl_setopt($this->curlHandle, CURLOPT_FAILONERROR, true); 120 | 121 | if ($method === 'post') { 122 | curl_setopt($this->curlHandle, CURLOPT_POST, true); 123 | } 124 | 125 | return $this->curlHandle; 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /src/Concerns/ArgumentConverter.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'default' => 'background:none; color:#CC7832; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:0; word-break: break-all', 13 | 'num' => 'font-weight:bold; color:#1299DA', 14 | 'const' => 'font-weight:bold', 15 | 'str' => 'font-weight:bold; color:#629755;', 16 | 'note' => 'color:#6897BB', 17 | 'ref' => 'color:#6E6E6E', 18 | 'public' => 'color:#262626', 19 | 'protected' => 'color:#262626', 20 | 'private' => 'color:#262626', 21 | 'meta' => 'color:#B729D9', 22 | 'key' => 'color:#789339', 23 | 'index' => 'color:#1299DA', 24 | 'ellipsis' => 'color:#CC7832', 25 | 'ns' => 'user-select:none;', 26 | ] 27 | ]; 28 | 29 | public static function convertToPrimitive($argument) 30 | { 31 | if (is_null($argument)) { 32 | return null; 33 | } 34 | 35 | if (is_string($argument)) { 36 | return $argument; 37 | } 38 | 39 | if (is_int($argument)) { 40 | return $argument; 41 | } 42 | 43 | if (is_bool($argument)) { 44 | return $argument; 45 | } 46 | 47 | $cloner = new VarCloner(); 48 | 49 | $dumper = new HtmlDumper(); 50 | $dumper->setStyles(static::$themes['light']); 51 | 52 | $clonedArgument = $cloner->cloneVar($argument); 53 | 54 | return $dumper->dump($clonedArgument, true); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Concerns/Hostname.php: -------------------------------------------------------------------------------- 1 | getPayloads(); 20 | } 21 | 22 | public function __construct(array $values) 23 | { 24 | $this->values = $values; 25 | } 26 | 27 | public function getPayloads(): array 28 | { 29 | return array_map(function ($value) { 30 | return $this->getPayload($value); 31 | }, $this->values); 32 | } 33 | 34 | protected function getPayload($value): Payload 35 | { 36 | if (is_bool($value)) { 37 | return new BoolPayload($value); 38 | } 39 | 40 | if (is_null($value)) { 41 | return new NullPayload(); 42 | } 43 | 44 | if ($value instanceof CarbonInterface) { 45 | return new CarbonPayload($value); 46 | } 47 | 48 | $primitiveValue = ArgumentConverter::convertToPrimitive($value); 49 | 50 | return new LogPayload($primitiveValue); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Logdesk.php: -------------------------------------------------------------------------------- 1 | sendRequest($payloads); 26 | } 27 | 28 | public function sendRequest($payloads): self 29 | { 30 | $request = new Request($payloads); 31 | //dd($request->toArray()); 32 | 33 | self::$client->send($request); 34 | 35 | return $this; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Payloads/BoolPayload.php: -------------------------------------------------------------------------------- 1 | bool = $bool; 13 | } 14 | 15 | public function getType(): string 16 | { 17 | return 'custom'; 18 | } 19 | 20 | public function getContent(): array 21 | { 22 | return [ 23 | 'values' => $this->bool, 24 | 'label' => 'Boolean', 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Payloads/CarbonPayload.php: -------------------------------------------------------------------------------- 1 | carbon = $carbon; 18 | 19 | $this->format = $format; 20 | } 21 | 22 | public function getType(): string 23 | { 24 | return 'carbon'; 25 | } 26 | 27 | public function getContent(): array 28 | { 29 | return [ 30 | 'values' => $this->carbon ? $this->carbon->format($this->format) : null, 31 | 'timestamp' => $this->carbon ? $this->carbon->timestamp : null, 32 | 'timezone' => $this->carbon ? $this->carbon->timezone->getName() : null, 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Payloads/LogPayload.php: -------------------------------------------------------------------------------- 1 | = 11111111111111111) { 24 | $values = (string)$values; 25 | } 26 | 27 | $this->values = $values; 28 | } 29 | 30 | public function getType(): string 31 | { 32 | return 'log'; 33 | } 34 | 35 | public function getContent(): array 36 | { 37 | return [ 38 | 'values' => $this->values, 39 | ]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Payloads/NullPayload.php: -------------------------------------------------------------------------------- 1 | null, 19 | 'label' => 'Null', 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Payloads/Payload.php: -------------------------------------------------------------------------------- 1 | $this->getType(), 11 | 'content' => $this->getContent() 12 | ]; 13 | } 14 | 15 | public function toJson(): string 16 | { 17 | return json_encode($this->toArray()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Request.php: -------------------------------------------------------------------------------- 1 | payloads = $payloads; 14 | } 15 | 16 | public function toArray(): array 17 | { 18 | $payloads = array_map(function (Payload $payload) { 19 | return $payload->toArray(); 20 | }, $this->payloads); 21 | 22 | return [ 23 | 'payloads' => $payloads, 24 | ]; 25 | } 26 | 27 | public function toJson(): string 28 | { 29 | return json_encode($this->toArray()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/helpers.php: -------------------------------------------------------------------------------- 1 | send(...$args); 12 | } 13 | } 14 | 15 | if (! function_exists('logdeskDie')) { 16 | function logdeskDie(...$args): void 17 | { 18 | logdesk(...$args)->die(); 19 | } 20 | } 21 | --------------------------------------------------------------------------------