CreateNewPlane.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Listeners;
  3. use App\Models\Plane;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. class CreateNewPlane
  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. Plane::create([
  26. "model" => "Модель 1",
  27. "production_date" => "2000-02-02",
  28. "operating_date" => "2000-02-02",
  29. "serviceability" => true
  30. ]);
  31. Plane::create([
  32. "model" => "Модель 2",
  33. "production_date" => "2000-02-02",
  34. "operating_date" => "2000-02-02",
  35. "serviceability" => true
  36. ]);
  37. Plane::create([
  38. "model" => "Модель 3",
  39. "production_date" => "2000-02-02",
  40. "operating_date" => "2000-02-02",
  41. "serviceability" => true
  42. ]);
  43. }
  44. }