Category "php"

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

Get number of working days between two dates in PHP [duplicate]

I am trying to find the total working days by specifying the first and end date and also the number of working days in a week. But unfortunate

Message: Set sys_temp_dir in your php.ini after installed composer

I've tried to install composer for my CodeIgniter project. The installation was successful. But, when I type on command-line composer --version, it shows: PH

How to implement placeholder in a php file for moodle plugin?

Hello im new to moodle plugin development and I need to make the "Enter course schedule here..." in the third line disappear when I enter text. If im not mistak

Convert PHP array into HTML tag attributes separated by spaces

I need to convert a PHP array into HTML tag attributes, with spaces and quotes, this is an example: $array=array( 'attr1'=>'value1', 'id'=>'examp

Php - Sum up the numbers in an array one by one

I have an array; $arr=array(1100,3150,4430,4430,5170,7450,7450,7450,8230); I want to show them in graph. I want my Y-Axis as my elements of that array and X-