I’m a little confused as to the “right” way to retrieve the current session object within a controller in Symfony 5.3. The current documentation says to typehint an argument as SessionInterface. However, this Symfony blog post says SessionInterface has been deprecated in favor of using Reque…
Tag: php
Codeigniter Multi Save Upload Path
I try to save the uploaded file in 2 paths, one inside a folder and contain the id and one outside the folder Here’s my code : When I run that code, the result is stucked Can you help me what’s wrong? Answer You set the upload_path key twice, which just overwrites itself. You’ll need to proc…
How to solve the @json Blade directive red underline on VSC?
This variables are working perfectly, I wonder why are they with a red underline. Anyone knows how to correct this? Error msg Answer Since VSCode doesn’t ship intellisense for [blade] template files in default, we need to install extra extensions for correct grammar checking and snippets support for .bl…
SQL error is thrown when laravel pagination is used
The problem is that I have made a relationship between 3 tables and I want to list the result in the view by grouping it only by barcode. My controller function is as follows; When I run the code in this way, the first page comes up, when I try to go to the next page, I get the following
Laravel 8: How to validate entering dimensions
I have a form and there is a field in this form called dimensions and users MUST enter a value like this: 10x10x10 So I am separating length, width and height by x. But now I don’t know how to make this validation with Laravel: So the question is: How can I force users to separate each dimensions by wri…
How can I set an api token in php?
I am currently working on my website, so at the moment I have a website which I made with Bubble.io (no-code), and what I want to do is develop a CRM website with php , what I want to do is connect my database from my Bubble.io website to be able to use the data on my CRM website, Bubble.io
How to redirect a user to different dashboards based on a level field in the ”’users”’ table in Laravel Breeze?
Please forgive me if my question is too generic but I am at my wits end. I have a users table with a level field as shown given below: $table->unsignedSmallInteger(‘level’)->after(‘password’); I want to redirect the user to different dashboards based on the value of the level fie…
Natural array sorting with proper decimal support in PHP
I want to sort an array with numbers in natural order, so numbers with a bigger value come after smaller ones like this: This is what I get as result, which is not the result I need, decimals are not threated correctly. There is already a similar question Array Sorting in php for decimal values but no fitting…
Can not install php7.4-soap on Debian 9
I am using Debian 9, and I recently upgraded PHP from 5.6 to 7.4. I was hit by the Class ‘SoapClient’ not found error when running an old PHP script, which worked very well under PHP 5.6. The phpinfo() lists “SOAP” module but it doesn’t have a dedicated “soap” section…
How to get object id from array using php mongod
I have a array $document after query findOne() I want get 60d2f531a5476f4eb220402b by use $document[‘_id’]->__toString(); but it never work Answer The stdClass object does not have any methods by default, so you address the $id field like this