Skip to content

Tag: php

Changing date format – Laravel

I have a column in my table named expiry which has type VARCHAR. In the column, there is a mixture of date format like YYYY-MM-DD and MM-DD-YYYY. How can i re-arrange the format MM-DD-YYYY to YYYY-MM-DD in my laravel view blade ? View In the view above, it throws an error Could not parse ’02-27-2021&#82…

Hide file in directory

I want to hide files from sub directory From this mydomain.com/file/file.php To this mydomain.com/file/ Do you guys know how to do that? Answer In your home directory/.htaccess, add this line: This will do this work: mydomain.com/file/ => mydomain.com/file/file.php mydomain.com/foo/ => mydomain.com/foo/…

wkhtmltopdf without creating a file in php

I have the wkhtmltopdf module in my Drupal which generates the pdf file by running the ‘wkhtmltopdf –options URL filename.pdf’ command using shell_exec function. The output of the file is fine, but I don’t want to store the pdf in the file system. I just want to show the output on the …

Sending mail with no required attachment Laravel 8

I’m working on a project in Laravel 8. I make a contact form that will be sent to my email address and contains name, email, message and attachment. Name, email and message are required but no attachment. When I send the form completely filled in (name, email, message and attachment) everything works fi…