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