Are you running npm run prod on production server?

|
saineshmamgain 2022-06-06 15:21:38
ramziddinrustamov 2022-06-06 14:05:46
Hi everyone , i have a quesion about how to print directly when i press the save button , laravel and livewire

What do you want to print?

ramziddinrustamov 2022-06-06 15:22:26
saineshmamgain 2022-06-06 15:21:38
What do you want to print?

I did by oython ok thanks for all

ramziddinrustamov 2022-06-06 15:22:45
laravel_discuss-123959.jpg

coder993 2022-06-06 15:24:00
saineshmamgain 2022-06-06 15:21:04
Are you running npm run prod on production server?

No

saineshmamgain 2022-06-06 15:24:42
You’ll have to run it on production in order to get production env variables in your js
saineshmamgain 2022-06-06 15:25:22
What I am guessing is you are running npm run prod on local. So it compiles your js with local variables.
coder993 2022-06-06 15:25:43
Oh thanks vary much
coder993 2022-06-06 15:26:06
I think it gets variables dynamicly
saineshmamgain 2022-06-06 15:27:21
No for js it doesn’t. Also don’t forget to add MIX_ prefix in your env variables which you want to use on js
Rahul Kahar 2022-06-06 15:28:14
coder993 2022-06-06 14:39:03
Hi !

Can’t access env variables by process.env.

Getting local variables.

Why????

Console.log(process.env.BASE_URL)

// return http://localhost

I think, you need to set ENV variable into production

coder993 2022-06-06 15:30:01
Rahul Kahar 2022-06-06 15:28:14
I think, you need to set ENV variable into production

Yeah, I did it

coder993 2022-06-06 15:30:53
Only I thought, that npm run always doing for local compiling
Rahul Kahar 2022-06-06 15:31:59
Try also clear cache also
PARVINDER SINGH 2022-06-06 15:35:04
My friend is looking job change as laravel developer he have 6 months of experience.
Amit Sharma 2022-06-06 15:43:13
anyone pls help me it’s a small mistake by me i can’t found that how it is possible ?
Amit Sharma 2022-06-06 15:43:41
laravel_discuss-123972.jpg
i am getting id in alert
Amit Sharma 2022-06-06 15:44:49
but when i try to show model it is not showing
Rahul Kahar 2022-06-06 15:44:50
Amit Sharma 2022-06-06 15:43:41
i am getting id in alert

Element code also send

Amit Sharma 2022-06-06 15:46:31
laravel_discuss-123977.jpg

Amit Sharma 2022-06-06 15:47:37
laravel_discuss-123980.jpg
in console i get data
Rahul Kahar 2022-06-06 15:48:55
Try to open modal before ajax and check modal open or not
Amit Sharma 2022-06-06 15:49:17
laravel_discuss-123982.jpg
in model id is same
Rahul Kahar 2022-06-06 15:50:04
If modal opened then issue in your ajax code
Rahul Kahar 2022-06-06 15:50:21
Check
Amit Sharma 2022-06-06 15:52:19
Rahul Kahar 2022-06-06 15:50:04
If modal opened then issue in your ajax code

not opened

Rahul Kahar 2022-06-06 15:52:42
So check your js
Jonathan Antunes 2022-06-06 15:53:22
Show the error message on console
Rahul Kahar 2022-06-06 15:53:31
Issue is there
Amit Sharma 2022-06-06 15:54:05
laravel_discuss-123991.jpg

Amit Sharma 2022-06-06 15:55:12
when i run commented button and without getting data it is showing
Amit Sharma 2022-06-06 15:55:58
what is my silly mistake
Jonathan Antunes 2022-06-06 15:57:09
Show your routers.php and the URL line of your Ajax method
Rahul Kahar 2022-06-06 15:58:23
data-target attribute not show in your button element
sundus_94 2022-06-06 16:08:46
laravel_discuss-124000.jpg
Anyone can tell me how can solve this error in testing
sundus_94 2022-06-06 16:09:18
sundus_94 2022-06-06 16:08:46
Anyone can tell me how can solve this error in testing

‘after’ => $createDaily->toArray()
this is a code

|