Search code examples
phplaravellaravel-5alertifyjs

Alertify in Laravel in hosting


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');
}

Solution

  • Make sure you added alertify library

    composer require odannyc/laravel-alertify
    

    or

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

    and try with

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

    If above line works then check $user->name this has data (dd($user->name))