Php

Convert given MySQL date string into a different format.

Convert from MySQL datetime to another format with PHP $format should be a PHP date format string. ‘U’ and ‘G’ formats will return a sum of timestamp with timezone offset. $date is expected to be local time in MySQL format (Y-m-d H:i:s). Historically UTC time could be passed to the function to produce Unix timestamp. If $translate is true then …

Convert given MySQL date string into a different format. Read More »

Basic composer cheatsheet

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Updating packages composer update Updates all packages composer update –with-dependencies Updates all packages and its dependencies composer update vendor/package Updates a certain package from vendor composer update vendor/* Updates all …

Basic composer cheatsheet Read More »

Reusable Laravel Routing patterns

If you would like a route parameter to always be constrained by a given regular expression, you may use the pattern method. You should define these patterns in the boot method of your App\Providers\RouteServiceProvider class: Below are handy list of patterns that you can reuse them everywhere: make more of your own to suit your needs: email, password Once the pattern …

Reusable Laravel Routing patterns Read More »

How to integrate the AWS SDK with other HTTP clients

The http_handler option is used to integrate the SDK with other HTTP clients. An http_handler option is a function that accepts a Psr\Http\Message\RequestInterface object and an array of http options applied to the command, and returns a GuzzleHttp\Promise\PromiseInterface object that is fulfilled with a Psr\Http\Message\ResponseInterface object or rejected with an array of the following exception data: exception – (\Exception) the exception that was encountered. response – (Psr\Http\Message\ResponseInterface) the response …

How to integrate the AWS SDK with other HTTP clients Read More »

How to use scheme in aws S3Client

URI scheme to use when connecting. The SDK uses “https” endpoints (i.e., uses SSL/TLS connections) by default. You can attempt to connect to a service over an unencrypted “http” endpoint by setting scheme to “http”. See the AWS Regions and Endpoints for a list of endpoints and whether a service supports the http scheme.

Php and Javascript logic for taking payment using stripe api

To get started, ensure you have your Stripe account set up and obtain your Stripe publishable key and secret key. Replace ‘YOUR_STRIPE_PUBLISHABLE_KEY’ in the index.html file and ‘YOUR_STRIPE_SECRET_KEY’ in the process_payment.php file with your respective keys. In the provided HTML form, users can enter their payment details, including the card number, expiry date, CVC, and …

Php and Javascript logic for taking payment using stripe api Read More »