Category "php"

Separate SQL commands in PHP

I have a (dynamically generated) file that includes a lot of SQL Statements that contain only data definition. Usually, I run the whole script as a single trans

get data-value with variable value

I have a data-value in my php code that is used in several places, for example: <a class="dropdown-item" data-value="<?= $i ?>"></a> <a cla

How to Create WooCommerce Subscription Product via. REST API?

I am able to find the REST API docs for WooCommerce: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product but am unable to figure out how t

Use environment variables in Laravel Nova

I am trying to follow: https://laravel.com/docs/9.x/mix#environment-variables My project setup is Laravel Framework 8.4 Php 7.4 Laravel Nova 3.0 .vue file in /n

Sagepay Error The Vendor failed to provide a RedirectionURL

Integrating the Sagepay payment in PHP. I am getting logs in notification URL and getting response data including transaction details. From there passing the re

How to render html from a @foreach loop in a textarea

Using Laravel 8 livewire, I need to render a list of name ($list) on per line in a textarea. I do this <div class=" border border-red-800 rounded-lg mt-8 p-4

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun

Use array_filter in foreach

I am presenting this problem when making a store in my database, which is data entered from a table in my view. Example: table For example, my user selects row

Use array_filter in foreach

I am presenting this problem when making a store in my database, which is data entered from a table in my view. Example: table For example, my user selects row

getting null values from the collection

I have an array that comes from an API request that has the stucture below. ^ array:40 [ "id" => 2 ... "categories" => array:2 [ "data" => ar

NginX: catch all file outside of root dir, with exceptions

I'm building a site running NginX / PHP and want all access to be processed by /private/routes.php. But I also want to add some exceptions to this for css/js-fi

Product varient size validation on Add to card in laravel

I'm using Laravel and I'm struggling a little bit with Add to cart button validation. The scenario is: if user want to Add to cart to cart is not added without

How to load Codeigniter 4 lang file into an array variable

Is there a way to load a file from Codeignier 4 Language directory and assign the array content to a variable. Instead of returning the translated line, I want

How To Access A Column In M-M Relationship Table In Laravel

I made a many-to-many relationship in laravel, where users can make announcements on an event. The problem is that I want to retrieve the announcement message f

Connection for controluser as defined in your configuration failed on ubuntu20.04 container

I'm trying to have one docker container with: ubuntu 20.04, on top of which I add apache, php, mysql and phpmyadmin (all on the same container) What's installed

How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

I am facing the issue while setup the Akaunting application. I cloned this repo from GITHUB source 1: https://github.com/akaunting/akaunting. I followed all the

curl lib in php needs html button click

I am trying to open a SAML xml endpoint with the following PHP code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$URL); curl_setopt($ch, CURLOPT

Extract string between first whitespace and last whitespace in php

I have this string i want to extract string which is between first occurence of whitespace and last occurence of white space $string="...ence it is apparent why

Laravel 5.5 won't render email with PHP 7.4

I am trying to render an email in Laravel 5.5, but no matter what I do, I get the following error on render: ErrorException (E_NOTICE) Trying to access array o