WithoutModelEvents.php 406 B

12345678910111213141516171819
  1. <?php
  2. namespace Illuminate\Database\Console\Seeds;
  3. use Illuminate\Database\Eloquent\Model;
  4. trait WithoutModelEvents
  5. {
  6. /**
  7. * Prevent model events from being dispatched by the given callback.
  8. *
  9. * @param callable $callback
  10. * @return callable
  11. */
  12. public function withoutModelEvents(callable $callback)
  13. {
  14. return fn () => Model::withoutEvents($callback);
  15. }
  16. }