mirror of
https://github.com/flarum/core.git
synced 2025-10-11 23:14:29 +02:00
Use Laravel's class-based Str and Arr helpers
Starting with version 5.9, the global funtions will be deprecated. * https://laravel-news.com/laravel-5-8-deprecates-string-and-array-helpers * https://github.com/laravel/framework/pull/26898
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Flarum\Foundation;
|
||||
|
||||
use Flarum\Foundation\Event\Validating;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Validation\Factory;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
@@ -89,7 +90,7 @@ abstract class AbstractValidator
|
||||
*/
|
||||
protected function makeValidator(array $attributes)
|
||||
{
|
||||
$rules = array_only($this->getRules(), array_keys($attributes));
|
||||
$rules = Arr::only($this->getRules(), array_keys($attributes));
|
||||
|
||||
$validator = $this->validator->make($attributes, $rules, $this->getMessages());
|
||||
|
||||
|
Reference in New Issue
Block a user