Is it recommended to ship logs directly from a PHP app to ElasticSearch? Or is it always better to store to file and use filebeat to ship the logs? I’m familiar with C# and Serilog implementation sending directly to ES and we’ve never had an issue with it, but was wondering if the same could be do…
Error: Expected Literal, got ‘*’ in Doctrine
I want to retrieve the number of rows in my courrier table. In my fixtures, I have these lines : I have these mistakes when I do symfony console doctrine:fixtures:load : What’s wrong with the * in my query ? Answer Doctrine expects you to use one of the fields of your entity. In SQL you don’t need…
Laravel (How do I add data to database)
Here’s my code that shows projects assigned to a user. HomeController home.blade.php ProjectController that show issues within the project. route: issues.blade.php I made a button in the issues page that shows a modal that has a form for adding issues for the selected project. Can you help me with this?…
zip file made by php shows wrong folder structure in js-dos but correct in windows
I am working on a project which requires me to collect several files from the server, zip them, and mount the zip as a drive with js-dos. Everything works ‘correctly’. During testing I manually made a zip file in windows and the code ran. For the final test I tried to mount the php generated zip b…
My Routing.php doesnt work properly after switch from nginx to apache
I am working on a small project on my local machine (in a nginx docker container) and I today was the first time when I uploaded it to my webserver and found out that it’s an apache server. Everything works fine, except for my router.php. When I visit example.com/admin I get an error 404 on my apache se…
preg_replace phone number sanitizing for international numbers
I have a snip of PHP code that we use to strip out spaces and non numericals from phone numbers in PHP which works great and it removes the leading 0 from the phone number as well: However in some scenarios the leading number is not a 0 it will be a 1 and we don’t want them stripped. so
How to make a single endpoint operation public in API Platform?
In API Platform, I have all the endpoints secured with JWT but I would like to have the POST User public so users can register themselves. How can I do this at entity level? if I implement this in security.yaml as usual in Symfony it works I just would like to know if I can do it at entity level
ob_get_status() has undocumented bits set in ‘flags’ entry
I’m having an issue with an output buffer not being called at the end of my PHP application. If I call get_ob_status(true) just before my script ends, I get the following output: The outer buffer looks broadly as I would expect, but there are two things that are odd about the inner buffer: It is empty (…
SQL to .csv – How to Get Rid of Double Array Entries
I’m using php code to get the values from a database table with 3 columns and put them into a .csv file The problem is that I’m always getting double entries of every column. Here is the first row that shows the problem. The array should be 3 items but it is 6. Here is how I’m getting the ab…
Laravel Blade Component – UTF-8 Encoding issue
I’m currently working on an application with Laravel 8 version. I have build a component named input-group which cause encoding issues that i don’t understand. The code of the component look like this : Here is the data that I inject into the value attributes => Inspecteur de l’Education …