vendredi 16 octobre 2015

How to create a function and make it globally available for formatting datetime in laravel 5

I am new to laravel. I am working on a project with a lots of datetime values that would be display on the UI. In Code Igniter I use to create a function like below and put in a helper directory and make available in my app.

function datetime_to_text($datetime){
    return date('j F Y, g:i a', strtotime($datetime));
}

How can I make such a function available globally in laravel 5 (Able to access in both my views and controllers)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Rg3ase
via IFTTT

Aucun commentaire:

Enregistrer un commentaire