【问题标题】:Alertify in Laravel in hosting在托管中提醒 Laravel
【发布时间】:2018-02-22 15:50:46
【问题描述】:

他们可以帮助我,我在 Laravel 有一个项目,在 Localhost 中一切正常,但现在它在服务中,alertify 不起作用并且不要让视图返回,如果我删除 alertify 一切正常(sql 行,boostrap,路由,没有 alertify 一切正常)

这是 Alertify 的功能之一,但它们不能按上述说明工作:

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

【问题讨论】:

    标签: php laravel laravel-5 alertifyjs


    【解决方案1】:

    确保您添加了 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-&gt;name 这是否有数据 (dd($user-&gt;name))

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-04
      • 1970-01-01
      • 1970-01-01
      • 2018-07-11
      相关资源
      最近更新 更多