This code allows me to display to the connected user the list of his written articles. However, I would like to choose the message that appears when no articles have been written (when the list is empty). I know that I need an IF statement but I don’t really know where to put it and with which data. I w…
Tag: php
Xdebug 3 doesn’t stop on breakpoints
I setted Xdebug extension and it’s installed, I can see it on phpinfo() but it doesn’t stop on the breakpoints and it doesn’t write anything into xdebug.log file. This is php.ini contents: And this is launch.json from VSCode: Answer You don’t say which of your three configurations you&…
SELECT from database when i don´t know position of null values
Good afternoon. I need your help to make correctly query into database. I have following table in DB with adresses, eg. id street house_nuber city district 1 First street 1225 City One NULL 2 NULL 25 Small city NULL 3 Second street 51 Roswell District nine 4 Third street 15963 Last city Another district In th…
How to return the children of an array under the parent?
There is an array, inside each element of the array there is a groupId, some elements of the array have children. How to get this kind of output: Parent category in array: Children category in array: I was able to only return parent categories, how to link child categories, in turn I could not figure out how …
PHP/Laravel FormRequests Types
I have a doubt about the FormRequest Class (I think it apply at other classes). I have a class which has a method init(). This method receive a VehicleRequest. I’m going to share a simplified version of the code: The class Car: The request I send (in car case) looks like: Now, in this example a Car clas…
How to capitalize a word that has all letters in as capital letters in css OR php
I have the following code and using css text-transform property with a value of capitalize or php ucwords() I get the title capitalized but when the title is provided with all letters as capitals it doesn’t work. How can I achieve the output to be capitalized regardless of the title provided? Answer A p…
how to descrypt an aes encryption from flutter in php
In my flutter app am using an encryption package called encrypt . and am able to encrypt my chat messages using this code but the problem is that the encrypted part will be stored in mysql database and flutter local database (sqflite) too and when i want to build a website for the app using php mysql html css…
Is the number the power of 2 – without using log10 ? PHP
I’m new to PHP I was taking coding challenge and I stumbled on this piece of code : The solution In the if section, what is happening there ? let’s say $n = 2 EDIT : So basicly & isn’t a logical operator It is a bitwise Operator Bitwise operators allow evaluation and manipulation of spec…
Extended Request missing data when reaching controller with type-hint
A lot of pieces to this so here’s the meat. Code very slightly tweaked for brevity. Extended class: Middleware: Routes: Controller: The /books1/5?foo=bar and frontend1() path works. $request is populated as expected. The /books2/5?foo=bar and frontend2() path is broken. $request has vast amounts of miss…
How to make a global variable for all blade laravel
Good Peoples. I have an issue with my project. In the layout blade, I need to fetch some data from the database. But I cannot pass variables as there has no route for the layout blade. It’s just a master blade. Is there any way to make a global variable and use it all blade? Thanks for the valuable repl…