Skip to content

Tag: php

Call to a member function save() on null in Laravel test

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…

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

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…

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