1

they could help me, I have a project in Laravel, everything works correctly in Localhost, but now that it is in the service the alertify do not work and do not let the view return, if I delete the alertify everything works fine (the sql lines, the boostrap, the routes, everything works fine without the alertify)

this is one of the functions with Alertify but they do not work as explained above:

public function create(CreateUserRequest $request)
{
    $user = new User($request->all());
    $user->password = bcrypt($request->get('password'));
    $user->save();

    alertify()->success('USER ' . $user->name . ' CREATED.')
    ->position('bottom right')
    ->delay(6000);
    return redirect()->route('users_path');
}
4

1 回答 1

0

确保您添加了 alertify 库

composer require odannyc/laravel-alertify

或者

<script src="https://cdn.rawgit.com/alertifyjs/alertify.js/v1.0.10/dist/js/alertify.js"></script>

并尝试

alertify()->success('USER WAS CREATED.')->delay(6000)->position('bottom right');

如果上面的行有效,那么检查$user->name这是否有数据(dd($user->name)

于 2018-02-23T07:08:59.073 回答