PlayMessage.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Livewire;
  3. use Livewire\Component;
  4. use Livewire\Attributes\On;
  5. use App\Http\Controllers\EmailController;
  6. class PlayMessage extends Component
  7. {
  8. #[On('msg-gen')]
  9. public function refresh()
  10. {
  11. $refresh;
  12. }
  13. public function render()
  14. {
  15. return view('livewire.play-message');
  16. }
  17. public function send(){
  18. // $file = session()->pull('audio');
  19. $text = session()->pull('text');
  20. $name = session()->pull('name');
  21. $mail = session()->pull('mail');
  22. $dates = session()->pull('dates');
  23. $audio = session()->pull('audio');
  24. $body = "Nom de l'entreprise : " .$name."<br>Mail : " .$mail."<br>Texte du message : " .$text."<br>Dates : ".$dates."<br>Audio : ".asset('storage/'.urlencode($audio));
  25. EmailController::index("Annonce - ".$name,$body);
  26. }
  27. public function cancel(){
  28. // $file = session()->pull('audio');
  29. $text = session()->pull('text');
  30. $name = session()->pull('name');
  31. $mail = session()->pull('mail');
  32. $dates = session()->pull('dates');
  33. $audio = session()->pull('audio');
  34. $refresh;
  35. }
  36. }