Skip to content
Advertisement

Tag: php

How convert this date: “16/11/2020 12:00:00 a. m.” to “2020-11-16 00:00:00” with PHP?

Currently, I am requesting an external web service to get some important information. However, the dates this web services return me are something like this: 16/11/2020 12:00:00 a. m. So, I was in other implementations using a code like this to get the DateTime: But it throws this error: DateTime::__construct(): Failed to parse time string (16/11/2020 12:00:00 am) at position

Problem with update database from API in Laravel PHP

I have a database of items, now I need to update the pictures in 10,000 records in the database, I make an API request, I receive an answer, but I just cannot process the answer correctly. I received result: And i need compare the name, and write in database icon_url value. But always i received error: Undefined array key “items”

Dynamic embedded form with OneToOne relationship

I’m trying to create a form for an article with an addon (tender). The article is in one-to-one relationship with the addon and the addon can be disabled (null). If the checkbox with an addon is checked, the addon needs to be validated, then submitted together with the article. The issue I’m having is, I’m unable to set the addon

Attaching / Sending .ics event via email in php

I am having trouble trying to send an .ics file ‘meeting invitation’ via email. I am using this class to quickly generate the contents of the .ics file: https://gist.github.com/jakebellacera/635416 The content generates correctly but I cannot get it to show as an attachment… so far only as string. I have even tried to encode it but it just shows the

saving card information to stripe and charge customer later

I want my customers to fill the cc information through stripe without charging them initially but i would manually charge them later accordingly to the service i provide them. it is it possible to simply save their card information on the stripe itself so i could manually go and charge them through stripe internally? i am new to stripe so

Laravel: How to configure eloqent to throw exception on database timeout?

If database is not available there is some seconds of loading. Then the log shows this error, should’nt that trigger the exception handler? (other errors end up their as expected) Then I see “504 Gateway Time-out The server didn’t respond in time.” Error. How do I configure eloquent so a database timeout throws a regular exception? (so the handler can

Advertisement