Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel collectivehtml secure route or url

in my view page I have this route:

{!! 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() !!}

getting mixed content error How can I get a secure route?

like image 998
Sid Heart Avatar asked Aug 20 '17 07:08

Sid Heart


1 Answers

add this to the boot method of your AppServiceProvider. This loads all content over http on local development and https on production

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

and always change your environment to production on production.

like image 133
Norris Oduro Avatar answered Sep 19 '22 13:09

Norris Oduro