I want to create a reusable AJAX-based select (select2) using Symfony form types and I’ve spent quite some time on it but can’t get it to work like I want. As far as I know you cannot override options of form fields after they have been added, so you have to re-add them with the new config. The Sy…
Use the symfony/mailer component without the symfony framework
I am working on a project that doesn’t use any framework and I would like to use Symfony Mailer component to handle sending emails. The installation part (composer require) was well handled and everything is included in my code without any error. However, I still have a problem : the documentation of th…
Posts not ordering by post__in
I am trying to display 3 blog posts that have been selected by the user in the admin. The order should go gridItem1, gridItem2 then gridItem3. I have set out my query below but it shows the selected posts but in date order not in the order I have outlined. I have searched other posts and added in the ‘s…
Sending mail using Mailjet smtp in laravel 8
I need to send a few mails with my laravel application, and they are not really personalized. I’ve used the markdown mail system in laravel, and everything was smooth for the tests. I had mailtrap setup to catch all the mails, no problems. Now I have to use mailjet to send mails – not to create em…
Use a String as a Seed for a Randomiser
It is possible to use a string as a randomiser seed to generate a number between two values in PHP. For example: $seed = ‘John’; srand($seed); echo rand(1, 10);
How to create dropdown select in Symfony easy admin crud panel?
I am new in Symfony. I have relation tables such as authors, books and book_authors. One book can have many authors and one author can have many books. So, here is my tables: And now, I am trying to implement crud controller with easy admin extension. And But in BookAuthorsCrudController I have a problems: I …
Return value must be of type ?Illuminate\Database\Query\Builder, App\Models\ModelName returned
I’m trying to have the following response: “user”: { “id”: 1, “first_name”: “john”, “last_name”: “doe”, &…
Add parent to url (PHP)
So my boss asked me to modify some urls of our page like so: What we have -> www.domain.com/finaPage What he wants -> www.domain.com/parent/finalPage I tried creating a directory named ‘parent’ …
Button Soft Delete Not Functioning laravel 8
i’m using laravel 8 to make a function softdeletes. In my view pages, my button is not working and there is no error just not functioning. i’m not sure if this unfunctioning is from the migration or …
Add array form data in google sheets api through PHP
I am using google sheets API in PHP to add my html form data in google spreadsheet. All other data have been appended in the respective cell of the sheet since each value had single data except one data which is in array since the html input data is in multiple checkbox. My google sheet form: And my code in