Monday, October 5, 2015

Test adsense

Registering A Custom Validator Resolver

Next, you need to register your custom Validator extension:
Validator::resolver(function($translator, $data, $rules, $messages)
{
    return new CustomValidator($translator, $data, $rules, $messages);
});
When creating a custom validation rule, you may sometimes need to define custom place-holder replacements for error messages. You may do so by creating a custom Validator as described above, and adding a replaceXXX function to the validator.
protected function replaceFoo($message, $attribute, $rule, $parameters)
{
    return str_replace(':foo', $parameters[0], $message);
}
If you would like to add a custom message "replacer" without extending the Validator class, you may use the Validator::replacer method:
Validator::replacer('rule', function($message, $attribute, $rule, $parameters)
{
    //
});

Sunday, September 13, 2015

/** * The event handler mappings for the application. * * @var array */ protected $listen = [ 'App\Events\PodcastWasPurchased' => [ 'App\Handlers\Events\EmailPurchaseConfirmation', ], ]; To generate a handler for an event, use the handler:event Artisan CLI command: php artisan handler:event EmailPurchaseConfirmation --event=PodcastWasPurchased Of course, manually running the make:event and handler:event commands each time you need a handler or event is cumbersome. Instead, simply add handlers and events to your EventServiceProvider and use the event:generate command. This command will generate any events or handlers that are listed in your EventServiceProvider: php artisan event:generate Firing An Event Now we are ready to fire our event using the Event facade: $response = Event::fire(new PodcastWasPurchased($podcast)); The fire method returns an array of responses that you can use to control what happens next in your application. You may also use the event helper to fire an event: event(new PodcastWasPurchased($podcast)); Closure Listeners You can even listen to events without creating a separate handler class at all. For example, in the boot method of your EventServiceProvider, you could do the following: Event::listen('App\Events\PodcastWasPurchased', function($event) { // Handle the event... });

Friday, January 16, 2015

Theo tiết lộ từ SportMail, Man Utd đã đạt thỏa thuận nhượng lại tiền đạo Angelo Henriquez cho Dinamo Zagreb với mức giá 1 triệu euro (780 nghìn bảng).
Với số tiền ít ỏi ấy, Quỷ đỏ đã chấp nhận lỗ trong thương vụ này bởi trước đó, họ đã sở hữu Henriquez với mức giá 4 triệu bảng.
Henriquez là 1 trong những bản hợp đồng cuối cùng của HLV Sir Alex trước khi ông tuyên bố giải nghệ. frown emoticon

Friday, October 11, 2013