Wednesday, 24 July 2019

The Date Problem for Laravel and Regional Settings

For every Laravel application birthday should be displayed as it was saved. It should have a type 'date' and those 'created_at' should be 'datetime' From New Zealand the record could be created Friday but for Cooks Island the record can be Thursday entry. This is where PHP Carbon date comes to uses and Javascript Moments. Install Moment and format as required. In VueJS create a filter import...
Share:

Monday, 8 July 2019

Laravel Eloquent Relationship 101

Laravel uses the default 'id' as the primary key when defining table. With this in mind we will be having difficulty especially if we are using Laravel eager loading style as stated in stackoverflow. In order to have that peace of mind when loading fields it is safer to create a different id key for different table. This is how to go with that approach. For our parent migration script we...
Share:

Popular Posts

Recent Posts

Pages

Powered by Blogger.

About Me

My photo
For the past 10 years, I've been playing with codes using PHP, Java, Rails. I do this for a living and love new things to learn and the challenges that comes with it. Besides programming I love spending time with friends and family and can often be found together catching the latest movie or planning a trip to someplace I've never been before.