Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function money_format() is deprecated #88

Open
rossi99 opened this issue Jul 4, 2020 · 1 comment
Open

Function money_format() is deprecated #88

rossi99 opened this issue Jul 4, 2020 · 1 comment

Comments

@rossi99
Copy link

rossi99 commented Jul 4, 2020

I am on Part 7 of the series and trying to deploy my app to Forge. I have uploaded it to the IP address and I'm now at the point of populating my database. Below the 'Shop The Collection' heading should be the three products that are stored in the db. This is what the view looks like before the command 'php artisan db:seed'

Screenshot 2020-07-04 at 15 28 14

And after I run this command :

Screenshot 2020-07-04 at 15 32 03

The view then changes to this:

Screenshot 2020-07-04 at 15 32 25

I added the APP_DEBUG to my .env file and when I ran the comment again I had this error returned:

Screenshot 2020-07-04 at 16 04 05

In my local machine it all works perfectly but I can't get it to work when its posted to the IP address on Forge, any ideas? Thanks!

@rossi99 rossi99 changed the title 500 | Server Error after db:seed with Forge Function money_format() is deprecated Jul 4, 2020
@Martin-1182
Copy link

The money_format function does not work in Windows. Take a look at this thread. As an alternative, just use the number_format function instead.

In app/helpers.php replace money_format line with return '$'.number_format($price / 100, 2);
In app/Product.php replace money_format line with return '$'.number_format($this->price / 100, 2);
In config/cart.php set the thousand_seperator to an empty string or you might get a 'non well formed numeric value encountered' error. It conflicts with number_format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants