Category "php"

Autoloading classes in PHPUnit using Composer and autoload.php

I have just installed PHPUnit version 3.7.19 by Sebastian Bergmann via Composer and have written a class I would like to unit test. I would like to have all my

How to put php code inside opening and closing shortcodes

I am working on a site and I am using a shortcode in my template files that has an opening and close. I would like to know if its possible to place wordpress th

Laravel post contact form giving me error 419

I've been trying to get a contact form to display as /contact when using the form, and after submitting the form. I'm getting Error 419 no matter what I seem to

TooManyRequestsException with Amazon Product Advertising API

I'm starting to develop a simple Symfony 5 application. It uses Amazon Product Advertising API 5.0 with the paapi5-php-sdk package (provided by TheWirecutter, s

Minimum order amount except for specific shipping method in WooCommerce

In WooCommerce, I use the following code to set a minimum order amount: add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' ); add_action( 'wo

Laravel You requested 1 items, but there are only 0 items available

I am getting row's column randomly to seed database, using eloquent : $physician = SelectOption::where('select_option_group_id', 1)->pluck('name')->rando

Laravel 9: change table and fields for authentication and login

I have changed the table and the Laravel Breeze fields for authentication to some custom ones. It looks fine but in AuthenticatedSessionController.php while I g

Sentry + Laravel: how to log an already catched Exception?

We're using Laravel ( 5.x to 7.x ) in a lot of project and all integrated with Sentry. In some edge case we need to catch some recoverable exceptions to allow p

Zig-zag scan an N x N array

I have a simple array. The array length always has a square root of an integer. So 16, 25, 36 etc. $array = array('1', '2', '3', '4' ... '25'); What I do, is

Zig-zag scan an N x N array

I have a simple array. The array length always has a square root of an integer. So 16, 25, 36 etc. $array = array('1', '2', '3', '4' ... '25'); What I do, is

Unable to run composer install

I'm trying to run composer install in my project but I have the following error [Composer\Downloader\TransportException] The "http://packagist.org/p/provider-2

how to make my own auto increment in php?

The in-built Auto-Increment in MySQL doesn't meet my requirement so I'm thinking about making a new one. Here is my requirement: Create an increment serial num

Input and output values for php into the browser?

I just started my module on php for school, having completed Javascript two months ago I am familiar with a lot of the elements but a bit rusty. Basically I set

Querying only one row from a one to many relationship laravel

I have a products table and a product_pictures table, where a single product can have many pictures (one to many relationship). I am trying to display all of th

How to convert binary string to normal string in php

Description of the problem I am trying to import email content into a database table. Sometimes, I get an SQL error while inserting a message. I found that it f

How to get transaction details in notify_url page in paypal

In paypal notify_url page I am not getting any values when I use cmd value as _cart.How can I get the transaction details in notify_url page <form action="

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

I've just downloaded and installed XAMPP 5.6.11 and started all the tools from the control panel. I've seen that one of it's new features is that it has a Welco

List all the transactional email activity with Sendinblue

I want to show the result of my transactional email activity page with the sendinblue api (CURL Method), with a table and columns : Email , Subject, events (del

Querying only one row from a one to many relationship laravel

I have a products table and a product_pictures table, where a single product can have many pictures (one to many relationship). I am trying to display all of th

Display Link Title Instead of URL in XSL

I'm learning XSL-as-I-Go, but I'm stuck. My function : public function SitemapHTML() { $xp = new XsltProcessor(); $xsl = new DomDoc