I have a problem with the cascade persist or merge, I have an application with two entities task and table (task_implements) When I create a task I choose cultures that are linked: If the user chooses 3 cultures => 3 tasks are created If the user chooses 3 cultures then 2 vehicles => 3 tasks must be created and each
Why can’t I use my instance in this trait?
I have this code trait GetCurrentConfigTrait { private static ?object $instance; private ?array $currentConfig; final public static function getCurrentConfig($name) { $class =…
Error in json data using php json_encode for php array
I am saving data in php array in loop and then use json_encode function. Here is my code foreach ($object_ids as $value) { $booking_data = array( ‘name’ => $name, ‘phone’ => …
laravel json data listing
I’m getting json data but I can’t list it in datatable Controller File public function index() { $data = Http::get(‘https://jsonplaceholder.typicode.com/posts’); return view(‘frontend….
How to load data from cache to a form in a laravel application?
I’m developing a site in laravel. I have a view for editing and creating posts that brings the data stored from the database. For example: The problem is that when the user makes modifications, try to save the data and has validation errors, he loses all the modifications he made (because when laravel reloads the page, the data is again
regex skip match if its follows by whitespace and a keyword
Currently trying to match comments with regexes but only if no function follows. Currently I use a regex which also matches the keyword function. And then check in the source code (php) if this group is set or not. https://regex101.com/r/l0j1ip/1 Now the question is whether it is possible to realize with pure regex. I have tried it with a simple
Warning: session_start(): Cannot find save handler ‘redis’
I want to set php.ini to use Redis as session handler. I did it this way: My Php application and Redis are running in 2 different containers. This is the code I’m trying to run in Php: Due to my searchs I found that I should install: but E: Unable to locate package php5-redis I’ve also tried: php-redis, php7-redis, php7.4-redis
Getting a product price from an ecommerce site using file get content
I am trying to get a product price using php and file_get_contents function. Here is my code. It is loading the whole page however I just need the price from this page. Can someone please help? Thanks Answer PHP Simple HTML DOM parser is a godsend for this kind of thing Get the code here Just include it on your
How to list files inside public folder?
I have a persistent volume defined in server under www/public/images/logo/ I want to list all the files inside that folder. So far I have done following lines with no luck. Can anybody please help ? Answer If you are want to list all files on same server then you can use php function scandir(); If you are want to list
Custom Twig filter from bundle: Unable to load the runtime
I’ve a small twig custom filter in my project created following https://symfony.com/doc/current/templating/twig_extension.html . As long as it sits in src/Twig, it works as expected. Now I’m trying to move it to a custom bundle (vendor/turbolabit/tli-base-bundle/src/Twig/) to make it reusable. I moved the two files: I tagged it in services.yaml: (I also tried as tags: [twig.extension], even if it would be