Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts

Friday, May 5, 2017

Laravel eloquent relationships

In laravel you can define all kind of relationships between database tables on the model itself (as in laravel, model is representation of d...

Wednesday, May 3, 2017

Insert using DB table doesnt update timestamp

In laravel there are two ways to insert data/record, using DB table or using model, but i found a problem when inserting the data using DB t...

How to update timestamp in Laravel

In laravel usually you have created_at and updated_at field in your database table, these are timestamps() that you define in your larave...

Tuesday, May 2, 2017

How to add primary key to Laravel model?

If you did not specify primary key in your model, laravel will assume the primary key of the table is 'id', so for example your prim...

Sunday, April 23, 2017

How to do raw query in Laravel

Besides the standard methods for database query that are available on laravel, you also have an option to do raw query, in this article i wi...

Saturday, March 25, 2017

Echoing data with default value in Laravel blade

When echoing data in laravel blade template using double or triple curly braces, you don't need to worry if the value is empty, it will ...