public static function boot() { parent::boot(); //删除时先删除相关文档、单页 self::deleting(function (User $user) { Article::where('uid', '=', $user->id)->delete(); Page::where('uid', '=', $user->id)->delete(); }); }
public static function boot() { parent::boot(); self::updated(function ($user) { /* * Update the locale (since its stored in a session variable we need to update it) * when changed in profile or use just logged in. */ if (user() and user()->id == $user->id) { Session::forget('app.locale'); } }); }
/** * Set the Sentry User Model Hasher to be the same as the configured Sentry Hasher */ public static function boot() { parent::boot(); static::setHasher(app()->make('sentry.hasher')); }
/** * Boot. */ public static function boot() { parent::boot(); self::$hasher = new \Cartalyst\Sentry\Hashing\BcryptHasher(); }
public static function boot() { parent::boot(); }