How to get instance of a collection in Laravel 8? I want to make a if statement if $event->like (CODE BELOW) does not exists for that specific event and an else statement I want to execute the …
Tag: php
How to merge static and dynamic forms together in php?
The my project has two forms. The first one is a static form that is used to collect user information (Form One inserts data into a table named, master). Second form is a dynamic form which collects additional information such as dependents (Form Two inserts data into a table named, dependents). formone.php c…
a PHPpunit test fail randomly
I have a Quiz class. This class load 10 questions from a database depending on the level and the type of the quiz Object: level 0 load the ten first, level 1 load the next ten and so on. So in my test i create in a test database 30 questions. Then i create quiz object with different level and
How to call PHP function using Ajax (Javascript, PHP and Yii1.1)
I am looking to call a PHP function through an onclick event. The PHP action within the controller then should start a download for a json File containing the needed data. I already know ajax and I am using it currently but somehow the function does not fire. I am 100% certain that I am doing something wrong,…
I am trying to run a query in php its working in phpMyAdmin but not in script [closed]
Iam trying to fetch related articles for a blog based project Query : $query = mysqli_query($con, “SELECT * FROM posts WHERE cat_id like ‘%$cat_arr[i]%’ AND NOT post_id = ‘$postid’”); …
I keep getting a warning when I put an array in a foreach loop
Here is my code. It gives me a warning when I use line 3 of my code. The $object passed in the parameter is a json object and I am trying to for loop through it and display tweets. The code at first doesn’t produce warnings but then out of no where it will and it pops my page with
How to RateLimit forgot-password requests in Laravel Fortify?
I am using Fortify (Laravel 8), and it does provide RateLimiter for login and two-factor, but not for the forgot-password requests. Without a (IP Address) RateLimiter, a very simple bot can execute a …
DataTables can’t read more than one Data
I would like to ask why is the DataTable can’t read more than 1 data in my Database? I would appreciate any help since I’m relatively new with the Data Table, thank you. As you can see it’s only showing 1 to 1 of 1 entries. But as seen in the table I have 5 retrieved data. and when I
Issue when adding product description at WooCommerce checkout
I’m trying to display the product description at WooCommerce checkout. I’m using: It takes the product short description and displays it below the product. It almost works perfectly, but it displays a colon (:) at the end of the description and the colon remains even if there is no short descripti…
Putting php arrays into html tags
I am trying to make a table that has different colors for each of its columns. There will be four columns. $colors = array(“background-color:red;”, “background-color:gold&…