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


PHP Validator::resolver方法代码示例

本文整理汇总了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);
     });
 }
开发者ID:guenthertheilen,项目名称:laravel-boilerplate,代码行数:13,代码来源:ValidationServiceProvider.php

示例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);
     });
 }
开发者ID:skovachev,项目名称:lacore,代码行数:11,代码来源:LacoreServiceProvider.php

示例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
 }
开发者ID:TFidryForks,项目名称:spira,代码行数:18,代码来源:AppServiceProvider.php

示例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'));
     });
 }
开发者ID:hifone,项目名称:dashboard,代码行数:51,代码来源:AdministratorServiceProvider.php

示例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'));
     });
 }
开发者ID:bytrix,项目名称:witkey,代码行数:49,代码来源:AdministratorServiceProvider.php

示例6: registerMaxFolderSizeValidator

 private function registerMaxFolderSizeValidator()
 {
     Validator::resolver(function ($translator, $data, $rules, $messages, $attributes) {
         return new MaxFolderSizeValidator($translator, $data, $rules, $messages, $attributes);
     });
 }
开发者ID:bitsoflove,项目名称:Media,代码行数:6,代码来源:MediaServiceProvider.php

示例7: boot

 public function boot()
 {
     Validator::resolver(function ($translator, $data, $rules, $messages) {
         return new \solyluna\Core\Validator($translator, $data, $rules, $messages);
     });
 }
开发者ID:arturorenteriia,项目名称:solyluna.noviembre,代码行数:6,代码来源:ValidatorServiceProvider.php

示例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);
     });
 }
开发者ID:dzirg44,项目名称:dogpro,代码行数:11,代码来源:ValidatorServiceProvider.php

示例9: boot

 public function boot()
 {
     Validator::resolver(function ($translator, $data, $rules, $messages) {
         return new \App\Validaciones\Validator($translator, $data, $rules, $messages);
     });
 }
开发者ID:desarrollo-para-triunfadores,项目名称:laautentica,代码行数:6,代码来源:ValidatorServiceProvider.php

示例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);
     });
 }
开发者ID:charlieboo,项目名称:creatrip,代码行数:11,代码来源:AppServiceProvider.php

示例11: boot

 public function boot()
 {
     \Illuminate\Support\Facades\Validator::resolver(function ($translator, $data, $rules, $messages) {
         return new Validator($translator, $data, $rules, $messages);
     });
 }
开发者ID:pixelindustries,项目名称:extended-validators,代码行数:6,代码来源:ExtendedValidationServiceProvider.php

示例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);
     });
 }
开发者ID:giordanolima,项目名称:laravel-adminlte,代码行数:9,代码来源:ValidacoesServiceProvider.php

示例13: boot

 public function boot()
 {
     Validator::resolver(function ($translator, $data, $rules, $messages) {
         return new \NensdeLlum\Validator($translator, $data, $rules, $messages);
     });
 }
开发者ID:saulzini,项目名称:NensdeLlum,代码行数:6,代码来源:ValidatorServiceProvider.php

示例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');
	}
开发者ID:pcerbino,项目名称:falcionevega,代码行数:81,代码来源:AdministratorServiceProvider.php

示例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);
     });
 }
开发者ID:amitavroy,项目名称:mywall,代码行数:11,代码来源:CustomValidationServiceProvider.php


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