Category "php"

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 https://www.w3schools.com/php/func_string_substr_replace.asp <?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,

Wordpress on Azure - How to change file upload limits

I'm trying to edit the WordPress upload limits for my site to at least 2GB for a migration I'm using WordPress on Azure (Linux), which uses this container under

How to make a foreign key not using primary key

I have a migration on Laravel for table pasien like this : public function up() { Schema::create('pasien', function (Blueprint $table) { $table->

PHP Discord OAUTH2 code sample not working

So this code I found below doesn't work I get to the authenticate screen then when t redirects me it just says Not logged in, Login in again. Does anyone know w

Too few arguments to function App\Http\Controllers\DataPegawaiController::storeDetail(), 1 passed in

i have problem like this. After insert new User to Pegawais table, i want to redirect to another view with user id parameter to define EducationHistory & Wo

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

I recently upgraded to the latest version of the facebook SDK and I'm having issues logging users in. I generate the login link just fine, but when facebook se

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

my website running perfect but today 1 order is placed by the customer, and I am getting this error in my website. Here is the screenshot of error error is her