I am trying to figure out relationships in laravel and have come to the end of my rope so I thought I would post my very first question here in hopes of figuring it out. I can generally find the …
Tag: php
How to immediately disable access to a user that is soft-deleted or no longer enabled?
In my application, users with the role ROLE_ADMIN are able to manually disable other user accounts, by setting enabled on the user account to false. Using a user checker, the user will not be able …
Finding the first entry of XML and displaying it
Im working on compiling a list using XML and PHP. I’m looking to find the first “destination tag” found in the RailVehicleStateClass for each train ID and echo it out. I tried doing a foreach loop to …
Larave noting save hash password in database
My need create new user in admin dashboard, this store function, but database saving string not hash, please help. When I output via dd(), then the hash working ` public function store(Request $…
When initiating a PHP class is there any benefit to passing reserved variables through the constructor?
I understand any user input needs to be sanitized. Any framework I’ve made does this. Naturally any “applicable” variables/names in any URL query or form input are pre-allocated specifically. Simple …
PHP & PDO: Fastest way to fetch data from
I have an HTML table which is fetched with thousands of rows of messages and the date these were sent by an user and I’m currently trying to understand how to fetch the data faster, as it takes 5 to 9 …
What is the difference between a JsonResource & ResourceCollection? in Laravel v6 or v7
Can someone explain the difference between a ResourceCollection and JsonResource? In Laravel 6 docs you can generate 2 different types of resources… ResourceCollection and JsonResource. https://…
PHPSpreadsheet: Formatting a cell for time also includes the date
I am trying to format a time cell using PHPSpreadsheet but it seems to be including the date as well when looking at the formula bar. There also seems to be some inconsistency when converting from a …
My localhost is refusing to connect on MacOS
I am running XAMPP and trying to test my PHP but cant get my localhost to connect. I have tried directing it to different ports and nothing has improved, i have tried kill httpd and stop the apache …
laravel – difference between foreignId() and unsignedBigInteger()
New to Laravel What is the difference between foreignId() and unsignedBigInteger() while linking tables $table->unsignedBigInteger(‘user_id’); $table->foreignId(‘user_id’); I’ve tried both …