I’m doing a Laravel course on Codecourse. So far I have a Category model: A factory: And a test However, when I run the test, I get: What gives? The course is a couple of years old so I think there’re a couple of differences between Laravel versions, but this seems a bit more fundamental. Answer Y…
Tag: php
Query a model using a relationship
I have a model called unit that has this relationship In the UserData model there is a column called user_id which I am trying to put in my condition in my query. I am trying to do a query like this but there is no user_id column in the Unit table, only though the users relationship Answer Ended up doing
PHP Interoperability – Print statements not showing in command line
I am having issues with PHP not returning print statements from Fortran. The idea is that PHP executes a command to compile a Fortran file then runs it. You are asked to input a number via print statement, problem is there is none showing up to CMD but the program is working as intended – when I enter a…
if/else with setInterval auto-refreshing and on click refreshing event jquery?
Struggling to get this to work properly…Making an if/else statement with setInterval that if class is clicked, content refreshes, else content auto refreshes after a specific time period. This is what I have for just auto refreshing atm (which works perfectly): What I’ve tried to get a “clic…
How to restart loop with different variable in php/html
as you can see im doing a loop as below. There are 2 data set involved: How do i restart this same loop by using $transaction_list_completed as the variable in the foreach statement? Suggestion to copy the loop is not what im looking for (maybe if no other solution) as the html content for this Modal consists…
Refresh selectpicker options after jQuery success is not working
I am trying to refresh a select after executing another jQuery. I am creating firstly the select options using cURL, which produces code like this. Then I have the HTML that looks like htis I am loading the options into the select with this jquery Which works fine. Then I have another script to delete an opti…
How to prepare data outputted from sql in php to run through the PHP machine learning Library
I am playing around with the LeastSquares regression algorithm from the PHP ML library. I can successfully run the code with the example given but when I try to run data from my database I get a blank screen returned and no error logs on the server. Here is the working example php file from the ML library: He…
Issues converting stdClass to array
I have converted one of my websites to use PDO database queries. All the queries are working perfectly except one and I have spent all day trying to solve this problem and nothing is working for me so …
Replace ‘0’ with 1 in phone numbers Laravel
I’m trying to replace users phone numbers to start with 1 instead of 0 but I’m stuck. I have this line $mobileNumber = implode(‘,’, $postData[‘phone’]); which outputs “0445329500,0569075729,…
Mac CLI PHP ini file location
I am using OSX Catalina and am trying to increase the memory limit for PHP – no matter where I look I cannot find the right PHP ini file to change this. When I go to /etc I see: so it looks like there is no php.ini file to be able to change the memory limit but I assume there