nomor laravel tambahkan 0 sebelumnya

<?php
$num = 4;
$num_padded = sprintf("%02d", $num);
echo $num_padded; // returns 04
?>
Lovely Llama