Last active
August 29, 2015 14:06
-
-
Save timReynolds/ca2842f0f43f684c8add to your computer and use it in GitHub Desktop.
Laravel Message Bag to vinaskrucas/notification method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function errorsToNotification(Illuminate\Support\MessageBag $errors) | |
{ | |
if($errors && $errors->has()){ | |
Notification::container(null, function($container) use ($errors) | |
{ | |
foreach ($errors->all() as $error) | |
{ | |
$container->error($error); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment