Create own rules for Laravel validator

Code
<?php

use Illuminate\Validation\Validator;
use 
Illuminate\Translation\Translator;
use 
Illuminate\Translation\FileLoader;
use 
Illuminate\Filesystem\Filesystem;

$filesystem = new Filesystem();
$loader = new FileLoader($filesystem'');
$translator = new Translator($loader'us');

// custom validator rule called "starts"
$customRules = [
    
'starts' => function($attribute$value$parameters) {
        return 
=== strpos($valuearray_shift($parameters));
    }
];

$data = [
    
'name' => 'John',
];

$rules = [
    
'name' => 'starts:Jo',
];

$validator = new Validator(
    
$translator,
    
$data,
    
$rules
);
$validator->addExtensions($customRules);

// does attribute "name" value starts with "Jo"?
$hasPassed $validator->passes();

var_dump($hasPassed);
Result
bool(true)
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6