當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。