Response.php 702B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Illuminate\Auth\Access;
  3. class Response
  4. {
  5. /**
  6. * The response message.
  7. *
  8. * @var string|null
  9. */
  10. protected $message;
  11. /**
  12. * Create a new response.
  13. *
  14. * @param string|null $message
  15. * @return void
  16. */
  17. public function __construct($message = null)
  18. {
  19. $this->message = $message;
  20. }
  21. /**
  22. * Get the response message.
  23. *
  24. * @return string|null
  25. */
  26. public function message()
  27. {
  28. return $this->message;
  29. }
  30. /**
  31. * Get the string representation of the message.
  32. *
  33. * @return string
  34. */
  35. public function __toString()
  36. {
  37. return $this->message();
  38. }
  39. }