DeveloperBreeze

Custom Blade Directive for Formatting Datetime in Laravel

// Define a custom Blade directive for formatting datetime
Blade::directive('datetime', function ($expression) {
    return "<?php echo ($expression)->format('m/d/Y H:i'); ?>";
});

Continue Reading

Handpicked posts just for you — based on your current read.

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!