Category "php"

json_encode fails because of Unknown charactar

I have this array : [responses] => Array ( [0] => Array (

PHP8 - SplFixedArray iterator's next() doesn't move key pointer

Please take a look at this code: <?php $array = new SplFixedArray(1); print "\nKey1: " . $array->getIterator()->key(); $array->setSize(5);

VS Code - does not recognize php 8 syntax

I have recently set up vsCode with PHP. However, it shows errors on following lines. public static function myFunction(): bool|string error : syntax error, un

how to send error emails to the developer in laravel 8 App

I am using laravel "laravel/framework": "^8.75" version. When deployed the app turn APP_DEBUG=false but users get errors but they can not know what is wrong and

Target class controller does not exist - Laravel 8

Here is my controller: <?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class RegisterControlle

Admin login don't redirect to panel

I import a project on my local but I don’t have an access to the admin panel. I enter the right id/password, but after this, it's redirect me to

How to convert a json response into a callable object in php?

I'm trying to convert the json response below in $response variable to a callable function like $response->getStatus() so it can return failed. Here's the re

Laravel sanctum vue spa being blocked when using ip address

I know a lot has been documented on about laravel sanctum configuration to avoid blocked requests from your spa frontend, but something that is not quite clear

Laravel 9 on PHP 8.1 slow responses - out of the box

I am using out of the box Laravel 9 / php 8.1 combo and loading initial page for 190ms sounds horrible. Last project I built used laravel7 and the response time

php Keeping only 1 date occurence in multi-dimensional array

I have this array with certain brand_ids, within these brands I have an array of dates in which a sale occured but these are based on the products in sale so th

Contact Form 7 & Flamingo - Getting Flamingo Post ID as a Mail tag

On a WordPress website I'm using Contact Form 7 and Flamingo to manage contact forms, and store the data. I've been using [_serial_number] in my emails to ident

php code to execute mysql pivot table statement

below is mysql code that creates for me a pivot table in mysql. i have tried to run it in php but it doesn't work. how can i execute the code in php so that i c

Laravel cache error: Too few arguments to function {closure}(), 0 passed in .../Illuminate/Cache/Repository.php on line 426 and exactly 2 expected

So I have a table called styles which has classes and styles for various places in blade templates. The table has a unique column the name and a column for clas

Facing an issue while displaying a stored data in a .txt file into my bootstrap card

I have a simple issue in my PHP project I made a small application that gives you the possibility to fill the form fields and stored all the data inside a .txt

"The GET method is not supported for this route. Supported methods: POST ."

I'm trying to add a new Post but whenever i submit i get the above error message. This is Route: Route::get('/p/create' , [App\Http\Controllers\PostsController:

PHP variable binding issue with html from controller for ajax response

Controller: $html = ""; $user_id = 10; $by = 'By Aaron'; $getLedgerData = "getLedgerData('" . $user_id. "','" . $by . "')"; $html .= "<a onclick=" . $getLedg

Unable to upload tiff images in Laravel

Tried to upload .tiff images using Laravel. used intervention/image for the image upload. it's not worked.shows this message. Unsupported image type image/tiff.

Laravel Spark installation problem, need to update something I imagine

I get the following error when I try to install Laravel Spark: Your requirements could not be resolved to an installable set of packages. Problem 1. - laravel/

Create dynamic sub array from a big one [duplicate]

I have an array, made by using explode and the delimiter #. I'm trying without success to create from this big array in PHP subarrays (the num

Create Certificate x509 with php problem with the parameters

I am trying to create a certificate with PHP with library openssl . The code is: global $gbl, $login, $ghtml; $today = date("m.d.y") + rand(1,10000); $cerpath