We are use stripe payments method in a php script. We are getting the following error: Please suggest how we can fix it Answer You created the charge with amount=1. As the error message explicitly says, the minimum amount is 50 cents. All amounts in Stripe’s API are in cents, so amount must be at least …
Tag: php
Calling a PHP function on button click?
I have a html button which has an onclick method. The function which is ran onclick has a php function in but is called in JS, like below. The page this code is on is a wordpress admin page. When the page loads, the php function is ran anyway instead of waiting for the button click event. Is there a
How to return custom API response for “No query results for model”, Laravel
I am building an RESTful API in Laravel 5.2. In my resource controllers I want to use implicit model binding to show resources. e.g. When a request is made for a resource that doesn’t exist Laravel automatically returns the NotFoundHttpException NotFoundHttpException I want to return my own custom respo…
Session sweeping lottery
Can someone explain what a session sweeping lottery is? I’ve attached the default session config file for the Laravel framework. Questions: 1. It says that some session drivers must manually sweep their storage location. Could someone describe this process and why it is necessary? What session drivers r…
Run powershell in PHP with new-Object
I have to manage a cash register from PHP. If I run the following commands via cmd there are no problems. The cash register print the string perfectly. I write the commands in this order: The problem comes when I try to do this from php. I created a web server ( XAMPP ) to ensure that it can send
preg_replace get each two characters from a word
Actually I’m trying to come up with a way of getting a string like “GEWO” out of the “Get Word” by using preg_replace function. The thing is there also can be a strings like “Get”, or “Get Word And another Word” so I have to get the proper string respectiv…
Laravel 5.2 New Password Must differ from Old One
Currently I am working on one project’s authentication module. I want to create functionality of password reset with the constraint that new password and old password must be different. But the problem is, the password is encrypted with bcrypt in database. So I can’t use Different validation rule …
PHP: Adding Arrow Key Support to STDIN/Single Character Processing
In PHP, I can read in input from a command line program with the following code This works well for simple input. However, if I try to use something like an back arrow key, my shell looks like the following i.e., the arrow key escape sequence of ^[[D is sent to the shell. PHP itself will interpret the arrow k…
How to get all pending jobs in laravel queue on redis?
The queue:listen was not run on a server, so some jobs were pushed (using Redis driver) but never run. How could I count (or get all) these jobs? I did not find any artisan command to get this information. Answer If someone is still looking for an answer, here is the way I did it: $connection is the RedisR…
disable web middleware for specific routes in laravel 5.2
I want to guest users have access to home page but in built in authentication process laravel redirects to login page. how can i give guest users access to home page? my routes.php: and authenticate.php and this is my kernel.php Answer Remove the middleware from HomeController construct: