Category "php"

Add restriction to WooCommerce coupons by allowed user ID

Let's say i'm using this code to create a coupon: $coupon_code = 'CODEOFF'; $amount = '10'; $discount_type = 'percent'; $coupon = array(

Laravel Command Schedule Not Working Properly

I'm building a project with Laravel 7.28 on localhost. I need to update a PDF every hour. For the beginning I created a command: <?php namespace App\Console

Why can't I access the response content when the Symfony HTTP Client encounters an error, and an exception is thrown instead?

I want to make a request to retrieve user info from OAUTH server with Symfony HttpClient but I can't fetch fetch the response directly when encountering an erro

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

I need help figuring out what's wrong. I want to install phpmyadmin on a server to import a wordpress DB but when I install it I have a problem with php-twig I

Pagekite error: FAIL: localhost:8080 is down

When i try to create a tunnel to my localhost:8000 with $ pagekite.py 8080 xxxx.pagekite.me, i get a error when someone trys to connect: (FAIL: localhost:8080 i

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

So im making a web based game similar to Torn City, where there could potentially be millions of users. My issue is regarding user inventories. I started out cr

Symfony5: Recommended pattern for using DataTransformers within Entities

I am currently trying to make our Symfony project type-safe and thereby refactoring it a bit, because it uses some anti-patterns here and there. My problem is t

PHP dynamic breadcrumb script creates wrong URL after switching to PHP 8.0

I'm using a PHP script to create a dynamic breadcrumb navigation. I found it several years ago in another forum where it was originally posted in 2006. I update

php Webserver on local machine. Pagekite error: FAIL: localhost:8080 is down

When i try to create a tunnel with $enter code here pagekite.py 8080 xxxx.pagekite.me , and someone trys to connect, there is this error: (FAIL: localhost:8080

adldap2: unable to retrieve custom user attribute

I've written a small php script to retrieve all the users in a certain group and obtain two values, username and employeeid. Unfortunately, the second field is

Laravel php artisan serve to mimic HTTPS

I have been searching around to see if there is a way I can mock SSL for local development using Laravel's artisan to serve HTTPS with no luck. Is this possibl

How can i update or reset my password without entering email field in laravel-8?

i have some users in my usertable ,when ever i sent to reset token to my mail based on that mail i am updating my user account password(reset-password)that's wo

renameColumn migration fails for existing column with columns does not exist error

I get the error Doctrine\DBAL\Schema\SchemaException : There is no column with name 'price' on table 'class_rooms'. while running migration to rename the price

Illuminate\Contracts\Container\BindingResolutionException Target class [app\Http\Controllers\FrontEnd\IndexController] does not exist

**Target class ** does not exist. ?? Why I didn't understand Error Is lluminate\Contracts\Container\BindingResolutionException Target class [app\Http\Control

Laravel trying to save $appends attributes

I am coding on Laravel 6, and stumbled up on this problem. I have accessors for a field that i need in my model in some cases, but it does not exist in my datab

args[max_input] woocommerce if statement confused

Cant seem to figure this out with if statements. Wanting it to show QTY 4 unless stock available is less than 4.. So far I have this.. function wpse_292293_quan

PHP 8.1: strftime() is deprecated

When upgrading to PHP 8.1, I got an error regarding "strftime". How do I correct the code to correctly display the full month name in any language? $date = str

WooCommerce Product Addons - append image to product addon field

I actually struggling with WooCommerce Product Addons plugin. The result which I want is to give possibility that woocommerce product addon fields (checkboxes t

Having problems with sessions not allowing flow from isset to isset in same page

I have a page titled "test.php" When I remove all session statements it works fine. However I wish to create session for security purposes (cannot get in witho

how to retrieve the first and last instance of a row in pdo dataset

I have a dataset that I retrieve using PDO and fetchall. I need to find the first date a part was sold and its cost then also I need to find the last date that