本文整理汇总了PHP中Illuminate\Support\Facades\Validator::resolver方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::resolver方法的具体用法?PHP Validator::resolver怎么用?PHP Validator::resolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Validator
的用法示例。
在下文中一共展示了Validator::resolver方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
Validator::extend('at_least_one_admin', 'App\\Validators\\RoleValidators@atLeastOneAdmin');
Validator::extend('own_admin_role', 'App\\Validators\\RoleValidators@ownAdminRole');
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new Validation($translator, $data, $rules, $messages);
});
}
示例2: boot
public function boot()
{
$this->package('skovachev/lacore');
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new \Skovachev\Lacore\Extensions\Validator($translator, $data, $rules, $messages);
});
Blade::extend(function ($view) {
$html = "<div id='message' class='alert <?php echo (Session::has('message-status') ? 'alert-' . Session::get('message-status') : ''); ?>'><?php echo Session::get('message'); ?></div>";
return str_replace("@message", $html, $view);
});
}
示例3: register
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind('League\\Fractal\\Serializer\\SerializerAbstract', 'League\\Fractal\\Serializer\\ArraySerializer');
$this->app->bind(ConnectionResolverInterface::class, 'db');
$this->app->bind(TransformerInterface::class, EloquentModelTransformer::class);
$this->app->bind(PaginatedRequestDecoratorInterface::class, RangeRequest::class);
//for some reason this part of is not shown as covered, though it really is
// @codeCoverageIgnoreStart
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new SpiraValidator($translator, $data, $rules, $messages);
});
// @codeCoverageIgnoreEnd
}
示例4: register
/**
* Register the service provider.
*/
public function register()
{
//include our view composers, and routes to avoid issues with catch-all routes defined by users
include __DIR__ . '/../../viewComposers.php';
include __DIR__ . '/../../routes.php';
//the admin validator
$this->app['admin_validator'] = $this->app->share(function ($app) {
//get the original validator class so we can set it back after creating our own
$originalValidator = LValidator::make(array(), array());
$originalValidatorClass = get_class($originalValidator);
//temporarily override the core resolver
LValidator::resolver(function ($translator, $data, $rules, $messages) use($app) {
$validator = new Validator($translator, $data, $rules, $messages);
$validator->setUrlInstance($app->make('url'));
return $validator;
});
//grab our validator instance
$validator = LValidator::make(array(), array());
//set the validator resolver back to the original validator
LValidator::resolver(function ($translator, $data, $rules, $messages) use($originalValidatorClass) {
return new $originalValidatorClass($translator, $data, $rules, $messages);
});
//return our validator instance
return $validator;
});
$arr = (include __DIR__ . '/../../config/administrator.php');
//set up the shared instances
$this->app['admin_config_factory'] = $this->app->share(function ($app) use($arr) {
return new ConfigFactory($app->make('admin_validator'), LValidator::make(array(), array()), $arr);
});
$this->app['admin_field_factory'] = $this->app->share(function ($app) {
return new FieldFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_datatable'] = $this->app->share(function ($app) use($arr) {
$dataTable = new DataTable($app->make('itemconfig'), $app->make('admin_column_factory'), $app->make('admin_field_factory'));
$dataTable->setRowsPerPage($app->make('session.store'), $arr['global_rows_per_page']);
return $dataTable;
});
$this->app['admin_column_factory'] = $this->app->share(function ($app) {
return new ColumnFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_action_factory'] = $this->app->share(function ($app) {
return new ActionFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_menu'] = $this->app->share(function ($app) {
return new Menu($app->make('config'), $app->make('admin_config_factory'));
});
}
示例5: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//the admin validator
$this->app['admin_validator'] = $this->app->share(function ($app) {
//get the original validator class so we can set it back after creating our own
$originalValidator = LValidator::make(array(), array());
$originalValidatorClass = get_class($originalValidator);
//temporarily override the core resolver
LValidator::resolver(function ($translator, $data, $rules, $messages) use($app) {
$validator = new Validator($translator, $data, $rules, $messages);
$validator->setUrlInstance($app->make('url'));
return $validator;
});
//grab our validator instance
$validator = LValidator::make(array(), array());
//set the validator resolver back to the original validator
LValidator::resolver(function ($translator, $data, $rules, $messages) use($originalValidatorClass) {
return new $originalValidatorClass($translator, $data, $rules, $messages);
});
//return our validator instance
return $validator;
});
//set up the shared instances
$this->app['admin_config_factory'] = $this->app->share(function ($app) {
return new ConfigFactory($app->make('admin_validator'), LValidator::make(array(), array()), Config::get('administrator::administrator'));
});
$this->app['admin_field_factory'] = $this->app->share(function ($app) {
return new FieldFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_datatable'] = $this->app->share(function ($app) {
$dataTable = new DataTable($app->make('itemconfig'), $app->make('admin_column_factory'), $app->make('admin_field_factory'));
$dataTable->setRowsPerPage($app->make('session.store'), Config::get('administrator::administrator.global_rows_per_page'));
return $dataTable;
});
$this->app['admin_column_factory'] = $this->app->share(function ($app) {
return new ColumnFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_action_factory'] = $this->app->share(function ($app) {
return new ActionFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_menu'] = $this->app->share(function ($app) {
return new Menu($app->make('config'), $app->make('admin_config_factory'));
});
}
示例6: registerMaxFolderSizeValidator
private function registerMaxFolderSizeValidator()
{
Validator::resolver(function ($translator, $data, $rules, $messages, $attributes) {
return new MaxFolderSizeValidator($translator, $data, $rules, $messages, $attributes);
});
}
示例7: boot
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new \solyluna\Core\Validator($translator, $data, $rules, $messages);
});
}
示例8: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new ValidatorService($translator, $data, $rules, $messages);
});
}
示例9: boot
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new \App\Validaciones\Validator($translator, $data, $rules, $messages);
});
}
示例10: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new afterFieldValidator($translator, $data, $rules, $messages);
});
}
示例11: boot
public function boot()
{
\Illuminate\Support\Facades\Validator::resolver(function ($translator, $data, $rules, $messages) {
return new Validator($translator, $data, $rules, $messages);
});
}
示例12: boot
/**
* Bootstrap the application services.
*/
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages, $attributes) {
return new Validacoes($translator, $data, $rules, $messages, $attributes);
});
}
示例13: boot
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new \NensdeLlum\Validator($translator, $data, $rules, $messages);
});
}
示例14: boot
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('frozennode/administrator');
//set the locale
$this->setLocale();
//the admin validator
$this->app['admin_validator'] = $this->app->share(function($app)
{
//get the original validator class so we can set it back after creating our own
$originalValidator = LValidator::make(array(), array());
$originalValidatorClass = get_class($originalValidator);
//temporarily override the core resolver
LValidator::resolver(function($translator, $data, $rules, $messages) use ($app)
{
$validator = new Validator($translator, $data, $rules, $messages);
$validator->setUrlInstance($app->make('url'));
return $validator;
});
//grab our validator instance
$validator = LValidator::make(array(), array());
//set the validator resolver back to the original validator
LValidator::resolver(function($translator, $data, $rules, $messages) use ($originalValidatorClass)
{
return new $originalValidatorClass($translator, $data, $rules, $messages);
});
//return our validator instance
return $validator;
});
//set up the shared instances
$this->app['admin_config_factory'] = $this->app->share(function($app)
{
return new ConfigFactory($app->make('admin_validator'), Config::get('administrator::administrator'));
});
$this->app['admin_field_factory'] = $this->app->share(function($app)
{
return new FieldFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_datatable'] = $this->app->share(function($app)
{
$dataTable = new DataTable($app->make('itemconfig'), $app->make('admin_column_factory'), $app->make('admin_field_factory'));
$dataTable->setRowsPerPage($app->make('session'), Config::get('administrator::administrator.global_rows_per_page'));
return $dataTable;
});
$this->app['admin_column_factory'] = $this->app->share(function($app)
{
return new ColumnFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_action_factory'] = $this->app->share(function($app)
{
return new ActionFactory($app->make('admin_validator'), $app->make('itemconfig'), $app->make('db'));
});
$this->app['admin_menu'] = $this->app->share(function($app)
{
return new Menu($app->make('config'), $app->make('admin_config_factory'));
});
//include our filters, view composers, and routes
include __DIR__.'/../../filters.php';
include __DIR__.'/../../viewComposers.php';
include __DIR__.'/../../routes.php';
$this->app['events']->fire('administrator.ready');
}
示例15: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
Validator::resolver(function ($translator, $data, $rules, $messages) {
return new CurrentPasswordValidation($translator, $data, $rules, $messages);
});
}