Laravel collectivehtml安全路线或网址

时间:2017-08-20 07:35:06

标签: php laravel-5 laravelcollective

在我的视图页面中,我有这条路线:

{!! Form::open(['url' => 'forumcomment/' . $forum->slug, 'files'=>false, 'id' => 'qw-commentform' ,'class' => 'qt-clearfix'])   !!}

        <hr class="qt-spacer-s"><div class="input-field">
        {!! Form::textarea('comment', null, ['class'=>'materialize-textarea', 'id'=>'my-editor', 'required'=>'required','aria-required'=>true]) !!}
        <label for="comment" class="">Comment*</label></div>
        <hr class="qt-spacer-s">
      {!! Form::submit('Post Comment', array( 'class'=>'qt-btn qt-btn-primary qt-btn-xl' )) !!}
    {!! Form::close() !!}

混合内容错误如何获得安全路线?

1 个答案:

答案 0 :(得分:5)

将此添加到AppServiceProvider的{​​{1}}方法中。 这将加载httplocal上的所有内容和https上的production

$this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');

并始终在生产时将environment更改为production