当前位置: 首页>>代码示例>>PHP>>正文


PHP Encrypter::encrypt方法代码示例

本文整理汇总了PHP中Illuminate\Contracts\Encryption\Encrypter::encrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP Encrypter::encrypt方法的具体用法?PHP Encrypter::encrypt怎么用?PHP Encrypter::encrypt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Contracts\Encryption\Encrypter的用法示例。


在下文中一共展示了Encrypter::encrypt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle the command.
  *
  * @param Repository $config
  * @param Encrypter  $encrypter
  * @return string
  */
 public function handle(Repository $config, Encrypter $encrypter)
 {
     $email = $encrypter->encrypt($this->user->getEmail());
     $code = $encrypter->encrypt($this->user->getResetCode());
     $query = "?email={$email}&code={$code}&redirect={$this->redirect}";
     return $config->get('anomaly.module.users::paths.reset') . $query;
 }
开发者ID:AkibaTech,项目名称:users-module,代码行数:14,代码来源:GetResetPasswordPath.php

示例2: encrypt

 /**
  * Encrypt the cookies on an outgoing response.
  *
  * @param  \Symfony\Component\HttpFoundation\Response  $response
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function encrypt(Response $response)
 {
     foreach ($response->headers->getCookies() as $key => $cookie) {
         $response->headers->setCookie($this->duplicate($cookie, $this->encrypter->encrypt($cookie->getValue())));
     }
     return $response;
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:13,代码来源:EncryptCookies.php

示例3: getData

 /**
  * The data that is needed in the view
  *
  * @return mixed
  */
 public function getData()
 {
     $params = ['project' => $this->user->pivot->project_id, 'user' => $this->user->id];
     $userHash = $this->encrypter->encrypt($params);
     $url = env('BASE_URL', 'http://knoters.com') . '/editor/' . $userHash;
     return ['url' => $url];
 }
开发者ID:kife-design,项目名称:knoters,代码行数:12,代码来源:SourceCreatedMailer.php

示例4: time

 function it_returns_the_timer_html(Encrypter $encrypter)
 {
     $time = time();
     $encrypter->encrypt($time)->willReturn($time);
     $html = (require __DIR__ . "/../../../src/Html/templates/timer.php");
     $this->html()->shouldReturn($html);
 }
开发者ID:ryanwinchester,项目名称:laravel-spamguard,代码行数:7,代码来源:SpamTimerSpec.php

示例5: encrypt

 /**
  * Encrypt the cookies on an outgoing response.
  *
  * @param  \Symfony\Component\HttpFoundation\Response  $response
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function encrypt(Response $response)
 {
     foreach ($response->headers->getCookies() as $cookie) {
         if ($this->isDisabled($cookie->getName())) {
             continue;
         }
         $response->headers->setCookie($this->duplicate($cookie, $this->encrypter->encrypt($cookie->getValue())));
     }
     return $response;
 }
开发者ID:Ceciceciceci,项目名称:MySJSU-Class-Registration,代码行数:16,代码来源:EncryptCookies.php

示例6: handle

 /**
  * Execute the job.
  *
  * @param  Mailer  $mailer
  * @return void
  */
 public function handle(Mailer $mailer, Encrypter $encrypter)
 {
     app()->setLocale($this->locale);
     $token = $encrypter->encrypt(json_encode(['id' => $this->user->getKey(), 'expires' => time() + 3600 * 72]));
     $user = $this->user;
     $mailer->send('core::emails.activate', compact('user', 'token'), function ($message) use($user) {
         $message->to($user->email);
         $message->subject(trans('core::auth.emails.activate.subject'));
     });
 }
开发者ID:ruysu,项目名称:laravel-core,代码行数:16,代码来源:SendActivationEmail.php

示例7: incrementOrDecrement

 /**
  * Increment or decrement an item in the cache.
  *
  * @param  string  $key
  * @param  mixed  $value
  * @param  \Closure  $callback
  * @return void
  */
 protected function incrementOrDecrement($key, $value, Closure $callback)
 {
     $prefixed = $this->prefix . $key;
     $cache = $this->table()->where('key', $prefixed)->lockForUpdate()->first();
     if (!is_null($cache)) {
         $current = $this->encrypter->decrypt($cache->value);
         if (is_numeric($current)) {
             $this->table()->where('key', $prefixed)->update(['value' => $this->encrypter->encrypt($callback($current))]);
         }
     }
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:19,代码来源:DatabaseStore.php

示例8: set

 /**
  * Set a given setting value.
  *
  * @param string $key
  * @param mixed $value
  * @return void
  */
 public function set($key, $value = null)
 {
     $this->fire('setting', $key, [$key, $value]);
     $generatedKey = $this->getKey($key);
     $serializedValue = $this->serializeValue($value);
     $this->repository->set($generatedKey, $this->isEncryptionEnabled() ? $this->encrypter->encrypt($serializedValue) : $serializedValue);
     if ($this->isCacheEnabled()) {
         $this->cache->forget($generatedKey);
     }
     $this->fire('set', $key, [$key, $value]);
     $this->context(null);
 }
开发者ID:sylarbg,项目名称:settings,代码行数:19,代码来源:Settings.php

示例9: locationUpdate

 /**
  * Fetch the list of Locations
  *
  * @Get("/", as="AdminLocationsIndex")
  */
 public function locationUpdate($id, Encrypter $encrypter)
 {
     //echo $id;
     $token = $encrypter->encrypt(csrf_token());
     //$locations = DB::table('locations')->where('id', '=', $id)->first();
     $query = "SELECT ld.`id` AS `location_id` , ld.`name` AS `location` , ld.`slug` AS `slug` , IF( la.`id` = ld.`id` , '', la.`id` ) AS `parent_id` , IF( la.`id` = ld.`id` , '', la.`name` ) AS `parent` , CAST( ld.type AS CHAR ) AS `location_type`\n                FROM locations_tree AS `lt`\n                INNER JOIN locations AS `ld` ON lt.`descendant` = ld.`id`\n                INNER JOIN locations AS `la` ON lt.`ancestor` = la.`id`\n                WHERE (lt.`length` =1 OR ld.`type` = 'Country') AND ld.id = '{$id}'";
     $locations = DB::select($query);
     /*print_r($locations);
       echo $locations['0']->location_id;
       exit;*/
     return view('admin.settings.locationsupdate', ['_token' => $token, 'locations' => $locations]);
     //return response()->json($locations->fetch($request->all()));
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:18,代码来源:AdminLocationsController.php

示例10: put

 /**
  * Store an item in the cache for a given number of minutes.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @param  int     $minutes
  * @return void
  */
 public function put($key, $value, $minutes)
 {
     $key = $this->prefix . $key;
     // All of the cached values in the database are encrypted in case this is used
     // as a session data store by the consumer. We'll also calculate the expire
     // time and place that on the table so we will check it on our retrieval.
     $value = $this->encrypter->encrypt($value);
     $expiration = $this->getTime() + $minutes * 60;
     try {
         $this->table()->insert(compact('key', 'value', 'expiration'));
     } catch (Exception $e) {
         $this->table()->where('key', '=', $key)->update(compact('value', 'expiration'));
     }
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:22,代码来源:DatabaseStore.php

示例11: incrementOrDecrement

 /**
  * Increment or decrement an item in the cache.
  *
  * @param string $key        	
  * @param mixed $value        	
  * @param \Closure $callback        	
  * @return int|bool
  */
 protected function incrementOrDecrement($key, $value, Closure $callback)
 {
     return $this->connection->transaction(function () use($key, $value, $callback) {
         $prefixed = $this->prefix . $key;
         $cache = $this->table()->where('key', $prefixed)->lockForUpdate()->first();
         if (is_null($cache)) {
             return false;
         }
         $current = $this->encrypter->decrypt($cache->value);
         $new = $callback($current, $value);
         if (!is_numeric($current)) {
             return false;
         }
         $this->table()->where('key', $prefixed)->update(['value' => $this->encrypter->encrypt($new)]);
         return $new;
     });
 }
开发者ID:sapwoo,项目名称:portfolio,代码行数:25,代码来源:DatabaseStore.php

示例12: encryptPayload

 /**
  * Encrypt payload.
  *
  * @return string
  */
 protected function encryptPayload()
 {
     $payload = json_encode($this->payload);
     return $this->encrypter->encrypt($payload);
 }
开发者ID:classid,项目名称:core-payload,代码行数:10,代码来源:Broker.php

示例13: handle

 /**
  * Handle the command.
  *
  * @return string|null
  */
 public function handle(Encrypter $encrypter)
 {
     $email = $encrypter->encrypt($this->user->getEmail());
     $code = $encrypter->encrypt($this->user->getActivationCode());
     return "/users/activate?email={$email}&code={$code}&redirect={$this->redirect}";
 }
开发者ID:jacksun101,项目名称:users-module,代码行数:11,代码来源:GetActivatePath.php

示例14: locations

 /**
  * Display the locations available for gourmetitup
  *
  * @Get("/locations", as="adminSettingsLocations")
  * @return Response
  */
 public function locations(Encrypter $encrypter)
 {
     $token = $encrypter->encrypt(csrf_token());
     return view('admin.settings.locations', ['_token' => $token]);
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:11,代码来源:AdminSettingsController.php

示例15: put

 /**
  * Put an item into the storage.
  *
  * @param string $key
  * @param string $data
  *
  * @return void
  */
 public function put($key, $data)
 {
     $this->store->put($key, $this->encrypter->encrypt($data));
 }
开发者ID:AltThree,项目名称:Storage,代码行数:12,代码来源:EncryptingStore.php


注:本文中的Illuminate\Contracts\Encryption\Encrypter::encrypt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。