Closed matthijs-neijenhuijs closed 8 years ago
Can you provide code snippet where you add message to message bag?
This was working in the version 5.0:
public function store() { $result = $this->blog->create(Request::all());
if(isset($result->id)) {
\Notification::success('The blog was inserted.');
return \Redirect::route('admin.blog.index');
}
\Notification::error($result->errors()->all());
return \Redirect::back()->withInput();
}
The output of $result->errors()->all():
Array ( [0] => The title must be between 4 and 165 characters. )
You need to pass messages as string
So i need to make a foreach loop? It was working in older version. There is no way to send validations errors right away to the notifications?
This is working:
foreach($result->errors()->all() as $error) {
\Notification::error($error);
}
Is it possible to make function likeNotification::errors ?
Yes, at the moment you have to
This:
{!! Notification::showAll() !!}
gives:
Array to string conversion (View: /Users/matthijs/www/newdutchbridge/resources/views/frontend/basic/contact.blade.php)