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


PHP Fluent::toArray方法代码示例

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


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

示例1: sendAuthorization

 /**
  * Send the request after setting authorization params
  * @return Illuminate\Http\Response
  */
 public function sendAuthorization()
 {
     $this->request->merge($this->params->toArray());
     $this->oauth->getIssuer()->setRequest($this->request);
     $token = $this->oauth->issueAccessToken();
     if (auth()->check()) {
         $token['user'] = auth()->user();
     }
     return response()->json($token);
 }
开发者ID:ruysu,项目名称:laravel-core,代码行数:14,代码来源:AuthController.php

示例2: update

 /**
  * Update setting.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\SettingUpdater  $listener
  * @param  array  $input
  *
  * @return mixed
  */
 public function update(SettingUpdateListener $listener, array $input)
 {
     $input = new Fluent($input);
     $driver = $this->getValue($input['email_driver'], 'mail.driver');
     $validation = $this->validator->on($driver)->with($input->toArray());
     if ($validation->fails()) {
         return $listener->settingFailedValidation($validation->getMessageBag());
     }
     $memory = $this->memory;
     $memory->put('site.name', $input['site_name']);
     $memory->put('site.description', $input['site_description']);
     $memory->put('site.registrable', $input['site_registrable'] === 'yes');
     $memory->put('email.driver', $driver);
     $memory->put('email.from', ['address' => $this->getValue($input['email_address'], 'mail.from.address'), 'name' => $input['site_name']]);
     if (empty($input['email_password']) && $input['enable_change_password'] === 'no') {
         $input['email_password'] = $memory->get('email.password');
     }
     if (empty($input['email_secret']) && $input['enable_change_secret'] === 'no') {
         $input['email_secret'] = $memory->get('email.secret');
     }
     $memory->put('email.host', $this->getValue($input['email_host'], 'mail.host'));
     $memory->put('email.port', $this->getValue($input['email_port'], 'mail.port'));
     $memory->put('email.username', $this->getValue($input['email_username'], 'mail.username'));
     $memory->put('email.password', $this->getValue($input['email_password'], 'mail.password'));
     $memory->put('email.encryption', $this->getValue($input['email_encryption'], 'mail.encryption'));
     $memory->put('email.sendmail', $this->getValue($input['email_sendmail'], 'mail.sendmail'));
     $memory->put('email.queue', $input['email_queue'] === 'yes');
     $memory->put('email.key', $this->getValue($input['email_key'], "services.{$driver}.key"));
     $memory->put('email.secret', $this->getValue($input['email_secret'], "services.{$driver}.secret"));
     $memory->put('email.domain', $this->getValue($input['email_domain'], "services.{$driver}.domain"));
     $memory->put('email.region', $this->getValue($input['email_region'], "services.{$driver}.region"));
     Event::fire('orchestra.saved: settings', [$memory, $input]);
     return $listener->settingHasUpdated();
 }
开发者ID:stevebauman,项目名称:foundation,代码行数:42,代码来源:Setting.php


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