Last active
March 29, 2019 13:22
-
-
Save MarceauKa/11970514bee91deaa68162e224894a96 to your computer and use it in GitHub Desktop.
Laravel Blade Errors
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
<?php | |
Blade::directive('errormessage', function ($expression) { | |
return '<?php if ($errors->has(' . $expression . ')): echo \'<span class="help-block">\'.$errors->first(' . $expression . ').\'</span>\'; endif; ?>'; | |
}); | |
Blade::directive('errorexists', function ($expression) { | |
return '<?= $errors->has(' . $expression . ') ? " has-error" : ""; ?>'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment