MergeValue.php 459B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Illuminate\Http\Resources;
  3. use Illuminate\Support\Collection;
  4. class MergeValue
  5. {
  6. /**
  7. * The data to be merged.
  8. *
  9. * @var array
  10. */
  11. public $data;
  12. /**
  13. * Create new merge value instance.
  14. *
  15. * @param \Illuminate\Support\Collection|array $data
  16. * @return void
  17. */
  18. public function __construct($data)
  19. {
  20. $this->data = $data instanceof Collection ? $data->all() : $data;
  21. }
  22. }