CreateExampleTasks.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Listeners;
  3. use Illuminate\Contracts\Queue\ShouldQueue;
  4. use Illuminate\Queue\InteractsWithQueue;
  5. use App\Models\Task;
  6. class CreateExampleTasks
  7. {
  8. /**
  9. * Create the event listener.
  10. *
  11. * @return void
  12. */
  13. public function __construct()
  14. {
  15. //
  16. }
  17. /**
  18. * Handle the event.
  19. *
  20. * @param object $event
  21. * @return void
  22. */
  23. public function handle($event)
  24. {
  25. Task::create([
  26. "name" => "Встреча у начальника",
  27. "type_id" => 1,
  28. "place" => "Работа",
  29. "date" => now()->format("d.m.Y"),
  30. "time" => "12:00",
  31. "duration" => "01:00",
  32. "comment" => "Важно!!"
  33. ]);
  34. Task::create([
  35. "name" => "Мероприятие",
  36. "type_id" => 2,
  37. "place" => "Иркутск",
  38. "date" => now()->format("d.m.Y"),
  39. "time" => "13:00",
  40. "duration" => "01:00",
  41. "comment" => "Надо быть!"
  42. ]);
  43. }
  44. }