Closed kevinklika closed 9 years ago
Sorry, can`t understand your question... But "successInstant" is used to render message in same request, ant "success" is not.
@kevinklika you would use Notification::success()
if the action the use requested was successful and Notification::error()
if it was not successful. You would then use the others (info and warning) in circumstances in which you decide they are appropriate. Essentially, they simply generate alert-success
, alert-danger
, alert-info
and alert-warning
.
Hopefully, this snippet will help to explain:
public function store()
{
$user = new User;
$data = Input::all();
$user->fname = $data['fname'];
$user->surname = $data['surname'];
$user->email = $data['email'];
$user->password = $data['email'];
if ($user->save()) {
Notification::success('User successfully updated!');
return Redirect::route('manage.users.index');
}
Notification::error($user->errors()->all());
return Redirect::route('manage.users.create', array($id));
}
The main question was the difference between ::success() and ::successInstant() and when you would want to use each...
"::success()" - when message will be rendered after page redirect. "::successInstant()" - when message will be rendered without page redirect
`\Notification::success('Your email address has been verified'); \Notification::successInstant('Your email address has been verified');
return redirect()->route('users.meetings.index');`
Within the view I have @notification
successInstant renders when running tests (phpunit using default laravel setup), success renders when running in browser?!
Hey,
success - flash, successInstant - non flash
I guess I don't entirely understand the usefullness of the default calls (Notification::success(...))...
When would you NOT want to use successInstant instead? I don't understand the use case for the regular notification types... can someone fill me in?