// Define a custom Blade directive for formatting datetime
Blade::directive('datetime', function ($expression) {
return "<?php echo ($expression)->format('m/d/Y H:i'); ?>";
});Custom Blade Directive for Formatting Datetime in Laravel
Related Posts
More content you might like
Code
php
Convert a human-readable date into a MySQL-compatible date format
No preview available for this content.
Jan 26, 2024
Read MoreDiscussion 0
Please sign in to join the discussion.
No comments yet. Be the first to share your thoughts!