Questions tagged [php]
PHP is a widely-used, general-purpose scripting language that is especially suited for web development.
4,266 questions
4
votes
3
answers
121
views
CSV handling class
I'm a hobby coder at best. I know enough to make helpful programs to assist me with day to day life and work (mostly with PHP/JS, some C#). I'm wanting to learn more about good coding practices. I ...
3
votes
2
answers
150
views
Laravel Wallet Service Backend
I’ve built a backend-only wallet service using Laravel 8, and it’s fully containerized with Docker. The project handles two user roles (Players and Backoffice Agents) and provides JWT-based ...
2
votes
1
answer
89
views
Return breakdown of component from database into its constituent materials; correctly handle recursive scenarios
I’m working with a MySQL database that models product compositions and raw materials. There are two relevant tables with columns as shown:
product_recipes:
...
5
votes
2
answers
235
views
Laravel as client for Strava 3rd party API
I’m developing a Laravel app which acts as a client to consume a 3rd party Strava API. My app also functions as an API for a frontend SPA. The user (which is just me for the time being) will already ...
3
votes
1
answer
185
views
Rendering data from mutiple models using controller and send to a single view
I have a master page, where I need to render data from multiple models. I have made a prototype of that page to show only the required conditions.
What is the best approach for controller to retrieve ...
6
votes
3
answers
537
views
PHP PDO wrapper class with security
I have created following php PDO wrapper class with the help of google and other some websites and my little knowledge.
I will use this for less coding work without change whole previous coded ...
3
votes
1
answer
233
views
Image preview and delete for Laravel blog application
I am working on a blogging application in Laravel 8.
I have put together a way to preview and remove the main article image.
In the ArticleController.php controller,...
3
votes
1
answer
95
views
A function that returns correct number of inserted, updated and skipped rows for INSERT or UPDATE query
When MySQL executes a Data Modification Query, it provides some additional info on the outcome, which is usually displayed in the console. This info is also being exposed through MySQL C API and this ...
2
votes
2
answers
176
views
Convert binary string to text base64 [closed]
I have a dictionary with a lot of symbols, each of which is encoded in a huffman binary string.
Example:
Symbol
Huffman Code
you
010
shall
0111
not
00111
pass
00001
...
...
Therefore I encode the ...
3
votes
1
answer
70
views
PHP script to generate named CSS grid areas
I wrote this PHP script to dynamically generate a topic header layout using CSS grid. The $columns array defines each column’s properties—like its CSS class, size, ...
4
votes
2
answers
498
views
Improving upon the Security of my Export Remote Database to Local PHP API
I am working on an in-house application, and I am working on how our application communicates with our remote server.
I have a PHP script that acts as an API to call to our MySQL DB and dump its ...
3
votes
1
answer
67
views
Wordpress custom registration form with additional fields
I work on plugin for custom auth pages for WordPress and I try to create a custom registration form with additional fields. it has a shortcode in Beaver Builder. Is this the correct approach, and ...
4
votes
1
answer
174
views
Replace node type in Drupal
In Drupal 11 or greater, this code is used to change the node type of a node. How would you improve the code if at all?
...
5
votes
1
answer
554
views
User Management API
I got as task to build a simple Laravel API that should:
1 - Create User API
2 - Get Users API
So I run the artisan command to ...
2
votes
0
answers
56
views
SPA in Symfony UX Turbo
I am currently learning Symfony UX. My focus today was on UX Turbo. I basically wanted to create a very basic Single Page Application.
User can 'login' using a form, submitting the form should render ...