Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 333 Bytes

errors_variable.md

File metadata and controls

11 lines (10 loc) · 333 Bytes

Errors variable

Laravel's $errors variable enables you to simplify these things as well and can already be leveraged to really cut down extraneous keystrokes.

// before
@if ($errors->has('email'))
    <span>{{ $errors->first('email') }}</span>
@endif
// after
{ !! $errors->first('email', '<span>:message</span>') !! }