I have just installed a Joedixon/Laravel-translation package in Laravel version 8. It shows the words but when I want to update it will not work. I did everything that was said in the documentation and also I’ve read this article about it but it also didn’t work. https://github.com/joedixon/larave…
gor error message when deleteing comment in Laravel project
working with Laravel 6 project and I have following CommentController, and My routes are as following but when I try to delete comment got following validation error message The comment field is required. how could I fix this problem here? edit.blade.php Answer Because HTML forms can’t send PUT, PATCH a…
How do I download a pdf blob file from database?
I’m trying to download a pdf file from the database stored as a blob datatype using the code blow, right now I’m only able to view the file as .php and not .pdf. The $result->mime contains the data-type of the file as application/pdf. The $result->pdf_file contains the PDF file itself as BLO…
How to automatically trim string when persisting a Doctrine entity?
Let’s say I have this entity: My controller: I want doctrine to register the name of myEntity as awesome name and not awesome name . Is there a way to configure doctrine to do this? Answer You do not need to “configure doctrine” in any way. Just use PHP and introduce the logic in your entity…
Sorting by post views count doesnt work. Plugin: “Post Views Counter” – WordPress
Im making news blog and I need to display daily posts. How doest daily posts work in my blog? : Im picking all posts for this day and sorting them by views count. There is the problem: I can’t sort by views count with Post Views Counter plugin. It doesnt returning any posts on WP_Query. My tryings: I tr…
Date time format in php – Fatal error: Uncaught Error: Call to a member function format() on string
I have this kind of error, and wondering if there’s anyway I can fix this that is the error message returning, My database is saving date and time on a single column but I like them to be separated, is it possible? Thanks Lads Answer it looks like you’re using it without a Model and so the data wi…
.htaccess stop directory listing and forward to handler.php
I am trying to implement SEO friendly URLs using .htaccess and PHP. I have achieved 90% of my goal and struggling with just one use case. Here is what happing, when I access the following url it lands on This is perfect and that is what I want because then I manage it myself. The real problem is when I
WordPress how to get a single post link
I want to go to single.php file when this button is clicked. but it doesn’t do anything. Answer Replace this: with this: And then style your a tag like a button.
Remove Child does not contain attribute value
I am practicing with XML DOM PHP parsing. I have such XML file (shorter version): I created attribute with name “id” and value “2” for two Tag elements. Now I would like to: Get only Tag elements which did not contain attribute ‘id=”2″‘; Get only Tag elements wh…
Make a dropdown selection according to the selected div (with jQuery)
I have these divs (links) that can be clicked on. I want to change a dropdown selection accordingly. So if it’s clicked on select2, it would change the dropdown value to 666 If select3, it would change to 667 and so on. I can’t modify dropdown values, however the target id’s CAN be exact as …