Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lawiszxc's avatar

My api's not functioning during live.

http://bubbles-laundry-system.great-site.net/login

what's the problem of that ? that is my hosting domain.

Email: [email protected] Password: 123123

0 likes
11 replies
Snapey's avatar

Wow. 10MB of (minified) javascript to load a login form.

Snapey's avatar

Your login form is trying to post to http://localhost:8000/api/web/login so you have hard coded URLs somewhere

1 like
lawiszxc's avatar

@Snapey that was my url since I created that so what should I do to call my api's?

Snapey's avatar

@lawiszxc Your API URL obviously needs to point to your production URL and not your local machine.

use the config('app.url') helper or one of the Laravel url generators to dynamically create the URL and never hard code URLs into your application

1 like
jlrdw's avatar

@lawiszxc only a suggestion, if you are creating an API and not sure about how to set everything up maybe you need to hire someone to help you.

I also suggest a security audit.

Edit:

Have you considered taking the free laravel lessons from here?

1 like
lawiszxc's avatar

@Snapey

APP_NAME=Laravel APP_ENV=production APP_KEY=base64:Wl0vp+aiK+dwqav9EZVEvSpu0kxUqUERE2UMabQ9ze0= APP_DEBUG=true APP_URL=http://bubbles-laundry-system.great-site.net

is that correct ?

I changed this also

const token = localStorage.getItem('token');

axios.defaults.baseURL = 'http://bubbles-laundry-system.great-site.net/api'; axios.defaults.headers['Authorization'] = Bearer ${token};

const app = createApp(App);

app.use(router); app.use(VueSweetalert2);

app.mount('#app');

Snapey's avatar
Snapey
Best Answer
Level 122

@lawiszxc Yes, but that is not where the problem lays.

The problem is in your javascript where you post the requests to the server

1 like

Please or to participate in this conversation.