javascript – How can I apply the toastr when the user goes to the next level?

This question is about when the user getw level and toastr will appear. This script comes from my sight blade model.

What I want to do is insert the toastr.js into my script, but I do not know how to implement it.

** Profile.blade **

  

** Controller **

                                        while ($ user-> curr_exp> = $ user-> exp_needed) {
if ($ user-> level == 10 || $ user-> level == 15 || $ user-> level == 20)
{
$ user-> reward_table + = 1;
}
$ user-> curr_exp - = $ user-> exp_needed;
$ user-> prev_exp = $ user-> exp_needed;
if ($ user-> level <= 19){
                   $user->exp_needed = $ user-> prev_exp * 1.4;
}
elseif ($ user-> level> = 20 && $ user-> level <= 39){
                   $user->exp_needed = $ user-> prev_exp * 1.1;
}
elseif ($ user-> level> = 40 && $ user-> level <= 59){
                   $user->exp_needed = $ user-> prev_exp * 1.05;
}
elseif ($ user-> level> = 60 && $ user-> level <= 79){
                   $user->exp_needed = $ user-> prev_exp * 1.04;
}
elseif ($ user-> level> = 80 && $ user-> level <= 99){
                   $user->exp_needed = $ user-> prev_exp * 1.03;
}
elseif ($ user-> level == 100) {
$ user-> exp_needed = $ user-> exp_needed * 0;
}
$ user-> level + = 1;
$ user-> save ();
}

Any ideas how to work this?

I use laravel 5.4 on this one. I do not understand how to display a live notification on the profile of the user at each level without adding tables from my database about it.