本文整理汇总了PHP中Illuminate\Support\Arr::except方法的典型用法代码示例。如果您正苦于以下问题:PHP Arr::except方法的具体用法?PHP Arr::except怎么用?PHP Arr::except使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Arr
的用法示例。
在下文中一共展示了Arr::except方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieveByCredentials
/**
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @return Authenticatable|null
*/
public function retrieveByCredentials(array $credentials)
{
$query = $this->model->newQuery();
foreach (Arr::except($credentials, 'password') as $key => $value) {
$query->where($key, $value);
}
return $query->first();
}
示例2: authenticate
/**
* Authenticate the user.
*
* @param array $input
*
* @return bool
*/
protected function authenticate(array $input)
{
$remember = isset($input['remember']) && $input['remember'] === 'yes';
$data = Arr::except($input, ['remember']);
// We should now attempt to login the user using Auth class. If this
// failed simply return false.
return $this->auth->attempt($data, $remember);
}
示例3: configLaravelAuthPackage
/**
* Config the laravel auth package (override).
*/
private function configLaravelAuthPackage()
{
/** @var \Illuminate\Contracts\Config\Repository $config */
$config = $this->config();
$config->set('laravel-auth', Arr::except($config->get('arcanesoft.auth'), ['route', 'hasher']));
if (SocialAuthenticator::isEnabled()) {
$this->app->register(\Laravel\Socialite\SocialiteServiceProvider::class);
}
}
示例4: saveModel
protected function saveModel(Eloquent $model, array $data)
{
$data = Arr::except($data, ['_token']);
foreach ($data as $key => $value) {
$model->setAttribute($key, $value);
}
$model->save();
return $model;
}
示例5: store
public function store($listener, array $inputs)
{
$validation = $this->validator->on('create')->with($inputs);
if ($validation->fails()) {
}
$credentials = Arr::only($inputs, ['email', 'password', 'first_name', 'last_name']);
$account = $this->account->createNewAccount($credentials);
$profile = $this->profile->createUserProfile($account, Arr::except($inputs, $credentials));
$this->fireEvent(self::MODULENAME, 'created', [$account]);
}
示例6: detect
/**
* Detect all extensions.
*
* @return \Illuminate\Support\Collection|array
*/
public function detect()
{
$this->events->fire('orchestra.extension: detecting');
$extensions = $this->finder()->detect();
$collection = $extensions->map(function ($item) {
return Arr::except($item, ['description', 'author', 'url', 'version']);
});
$this->memory->put('extensions.available', $collection->all());
return $extensions;
}
示例7: subscribe
/**
* subscribe.
*
* @method subscribe
*/
public function subscribe()
{
$this->laravel['events']->listen('composing:*', function ($view) {
$name = $view->getName();
$data = $this->limitCollection(Arr::except($view->getData(), ['__env', 'app']));
$path = self::editorLink($view->getPath());
preg_match('/href=\\"(.+)\\"/', $path, $m);
$path = count($m) > 1 ? '(<a href="' . $m[1] . '">source</a>)' : '';
$this->views[] = compact('name', 'data', 'path');
});
}
示例8: deactivate
/**
* Deactivate an extension.
*
* @param string $name
*
* @return bool
*/
public function deactivate($name)
{
$memory = $this->memory;
$active = $memory->get('extensions.active', []);
if (!isset($active[$name])) {
return false;
}
$memory->put('extensions.active', Arr::except($active, $name));
$this->dispatcher->deactivating($name, $active[$name]);
return true;
}
示例9: toCard
function toCard()
{
$ret = $this->toArray();
unset($ret['id']);
unset($ret['created_at']);
unset($ret['updated_at']);
unset($ret['deleted_at']);
unset($ret['js_filter']);
unset($ret['js_sort']);
unset($ret['order']);
return Arr::except($ret, $this->getHidden());
}
示例10: render
/**
* {@inheritdoc}
*/
public function render()
{
$grid = $this->grid;
// Add paginate value for current listing while appending query string,
// however we also need to remove ?page from being added twice.
$input = Arr::except($this->request->query(), [$grid->pageName]);
$rows = $grid->rows();
$pagination = true === $grid->paginated() ? $grid->model->appends($input) : '';
$data = ['attributes' => ['row' => $grid->rows->attributes, 'table' => $grid->attributes], 'columns' => $grid->columns(), 'empty' => $this->translator->get($grid->empty), 'grid' => $grid, 'pagination' => $pagination, 'rows' => $rows];
// Build the view and render it.
return $this->view->make($grid->view)->with($data)->render();
}
示例11: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// replace HTTP_HOST with site url setted in options to prevent CDN source problems
if (!option('auto_detect_asset_url')) {
$rootUrl = option('site_url');
if ($this->app['url']->isValidUrl($rootUrl)) {
$this->app['url']->forceRootUrl($rootUrl);
}
}
if (option('force_ssl')) {
$this->app['url']->forceSchema('https');
}
Event::listen(Events\RenderingHeader::class, function ($event) {
// provide some application information for javascript
$blessing = array_merge(Arr::except(config('app'), ['key', 'providers', 'aliases', 'cipher', 'log', 'url']), ['baseUrl' => url('/')]);
$event->addContent('<script>var blessing = ' . json_encode($blessing) . ';</script>');
});
}
示例12: open
/**
* Open up a new HTML form.
*
* @param array $options
*
* @return \Illuminate\Support\HtmlString
*/
public function open(array $options = [])
{
$method = Arr::get($options, 'method', 'post');
// We need to extract the proper method from the attributes. If the method is
// something other than GET or POST we'll use POST since we will spoof the
// actual method since forms don't support the reserved methods in HTML.
$attributes = ['method' => $this->getMethod($method), 'action' => $this->getAction($options), 'accept-charset' => 'UTF-8'];
// If the method is PUT, PATCH or DELETE we will need to add a spoofer hidden
// field that will instruct the Symfony request to pretend the method is a
// different method than it actually is, for convenience from the forms.
$append = $this->getAppendage($method);
if (isset($options['files']) && $options['files']) {
$options['enctype'] = 'multipart/form-data';
}
// Finally we're ready to create the final form HTML field. We will attribute
// format the array of attributes. We will also add on the appendage which
// is used to spoof requests for this PUT, PATCH, etc. methods on forms.
$attributes = array_merge($attributes, Arr::except($options, $this->reserved));
// Finally, we will concatenate all of the attributes into a single string so
// we can build out the final form open statement. We'll also append on an
// extra value for the hidden _method field if it's needed for the form.
$attributes = $this->getHtmlBuilder()->attributes($attributes);
return $this->toHtmlString('<form' . $attributes . '>' . $append);
}
示例13: getUser
/**
* Get the user for the given credentials.
*
* @param array $credentials
* @return \Illuminate\Contracts\Auth\CanResetPassword
*
* @throws \UnexpectedValueException
*/
public function getUser(array $credentials)
{
$credentials = Arr::except($credentials, ['token']);
$user = $this->users->retrieveByCredentials($credentials);
if ($user && !$user instanceof CanResetPasswordContract) {
throw new UnexpectedValueException('User must implement CanResetPassword interface.');
}
return $user;
}
示例14: getTables
protected function getTables()
{
$this->info('Начало получение таблиц');
// $connection = \DB::connection($this->connection_name);
$dbname = \DB::connection($this->connection_name)->getDatabaseName();
$sql = 'select TABLE_NAME AS t from information_schema.tables where table_schema=\'' . $dbname . '\'';
$tables = [];
$select = \DB::connection($this->connection_name)->select($sql, [], false);
foreach ($select as $k) {
$k = (string) $k->t;
$tables[$k] = $k;
}
$tables = Arr::except($tables, $this->ignore_tables);
$this->tables = $tables;
}
示例15: parseFailedJob
/**
* Parse the failed job row.
*
* @param array $failed
* @return array
*/
protected function parseFailedJob(array $failed)
{
$row = array_values(Arr::except($failed, ['payload']));
array_splice($row, 3, 0, $this->extractJobName($failed['payload']));
return $row;
}