Category "php"

I want to display default profile image if user do not have profile image

I am trying to display a default image if user do not have profile image but I am not getting what to do next so.. can any write further code as I tried this co

Can't exclude directories from .htaccess mobile redirect?

I'm using the .htaccess mobile redirect below which I found on an older post here. It works great, but I need to exclude several directories from the redirect r

woocommerce_wp_select options array from product attribute terms

I am trying to create a drop down list box in woocommerce but have it populated with data from the database. I have the majority of the code working but the po

How to create laravel storage symbolic link for production or sub domain system?

When I worked on laravel local development server php artisan storage:link works fine for me. But when I transfer my site to production server then I saw my pub

How can I get new CSRF token in LARAVEL by using ajax

I have created a form which is having a lot of fields and user can create an unlimited field in it. If a user spends more time on it CSRF token get expires and

Install mysql client in docker image

I am trying to build a docker image for php, which can handle database dumping in my mysql container. The problem is that it seems to install the mariadb versio

Is it possible to read a csv file column by column with League csv?

I wondered if it was possible to read a csv file written like this in symfony using League csv or something else. water_level,2,456,345 wind_speed,2

Laravel Jetsream Profile page not loading on fresh install

I have performed a fresh install of Laravel Jetstream. Upon completing all the steps outlined in the Jetstream (Inertia) set up process, the project starts up f

PHP - CURL using HTTPS [closed]

I am trying to get Json Data from a https url. I have tested and working code to do just this for http but I am yet to find a working version

Getting values for an enum?

I have an enum: enum Type: int { case OFFENSIVE = 1; case SPAM = 2; case IRRELEVANT = 3; } I understand I can get all types and their values with T

is substr_replace() in php useless? w3schools [closed]

As in <?php echo substr_replace("Hello","world",0); ?> where is the needle

Laravel Factory not calling callback 'afterCreating'

I'm trying to modify models after creating them with Factory. I have defined configure() method and within it what I want changed within the model. However, Lar

Testing subscription renewals on Stripe

I am using Stripe to test how my code would react to recurring subscription renewal payment attempts for a product we are working on (need to test success, fail

PHP Array split string and Integers

Below is an array of strings and numbers. How could the string and number values be split into separate arrays (with strings in one array and numbers in another

CodeIgniter force_download is not working

CodeIgniter force_download is not working My Code: if(!empty($articlefile)){ if(file_exists('./media/journals/xml/'.$articlefile)){ $this->load->hel

Redirect to previous page with php

The submit button is in contact-us.html, the code is in contact-us.php. I tried to use the header('Location: example'); with no luck... (I tried using the URL

Issue with laravel eloquent model property

I'm trying to print {{$day->date}} in a view. Instead of full date YYYY-MM-DD the property only returns year YYYY. Can anyone explain me why it is working li

500 (Internal Server Error) with Laravel & Docker [duplicate]

I create Laravel PHP application in Docker. First I setup Laravel app using laravel new laravelDockerApp it creates successfully.I verify

How to identify whether webp image is static or animated?

I am working on a project where a user can upload webp images. I know how to convert webp images into jpg/png, but am stuck on how to identify whether the webp

Yii2: How to download backup files using spanjeta/yii2-backup?

In a Yii2 project I want to download file backup. I have setup the download button in my action column. My code doesn't work, when I click the download button,