Skip to content

Commit

Permalink
Show error message and trim
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroennoten committed Oct 7, 2016
1 parent 24eed03 commit e9b55e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions resources/views/admin/lists/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
</ul>
<div class="tab-content">
<div class="tab-pane active" id="addOneMember">
@if (count($errors) > 0)
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
<div>{{ $error }}</div>
@endforeach
</div>
@endif
<form method="post"
action="{{ route('admin.newsletters.lists.members.store', $list) }}"
style="display: flex;"
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/Admin/Members.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function index($listId)

public function store($listId, Request $request)
{
$email = $request->input('email');
$name = $request->input('name');
$email = trim($request->input('email'));
$name = trim($request->input('name'));

if (! $this->emailValidator->isValid($email)) {
if ($request->wantsJson()) {
Expand Down

0 comments on commit e9b55e4

Please sign in to comment.