Level 6
Well, the forceScheme('https'); says it all, your Axios is probably still posting to the http instead of the https endpoints. Your API backend doesn't allow that, therefore giving you that error.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
error
Mixed Content: The page at 'https://site/home#/training/17/100' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://site/api/training/section/submit'. This request has been blocked; the content must be served over HTTPS.
AppServiceProvider
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
if (App::environment('production', 'local'))
{
URL::forceScheme('https');
}
// make forumChannels available with every view
view()->share('channels', Channels::get());
}
and I am posting from the vue form
submit() {
this.errors = {};
axios.post('/api/training/section/submit/', {
fields: this.fields,
product: this.product,
quiz: this.quiz
})
though this code working fine perfectly on my local but through a mixed content https error on Production
axios.post('//sitename/api/training/section/submit', {
fields: this.fields,
product: this.product,
quiz: this.quiz
})
Please or to participate in this conversation.