Category "php"

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

Laravel 5 controller sending JSON integer as string

On my development server the JSON response from the Laravel 5 controller shows the data in the correct types. e.g imdb_rating: 7.6 imdb_votes: 6271 But on t

Transpose csv file data [duplicate]

I need help to assign keys to an array in PHP. My code is: //First I make an array of a csv file $file="C:\path-to-csv\file.csv"; $csv= file

Creating a config file in PHP

I want to create a config file for my PHP project, but I'm not sure what the best way to do this is. I have 3 ideas so far. 1-Use Variable $config['hostname'

Limit WooCommerce products in cart only from one custom taxonomy

I'm trying to restrict customers on my Woocommerce store to only be allowed to order products from 1 "supplier" at a time. I am defining the "Supplier" by a cus

file_get_contents() without "Http" to access external URL [closed]

I'm attempting to access an external URL (API) echo file_get_contents("http://..."); However, I want to request this URL without the "Http://

Cannot pass null argument when using type hinting

The following code: class Type { } function foo(Type $t) { } foo(null); failed at run time: PHP Fatal error: Argument 1 passed to foo() must not be null