Skip to content

Instantly share code, notes, and snippets.

@overtrue overtrue/Model.php
Last active Oct 17, 2017

Embed
What would you like to do?
Model methods
<?php
namespace App\Models;
class Model
{
public static function withoutEvents(Closure $closure)
{
$dispatcher = self::getEventDispatcher();
self::unsetEventDispatcher();
call_user_func($closure);
self::setEventDispatcher($dispatcher);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.