Laravel eager loading example

Laravel eager loading example

One of the benefit of using laravel is that you can do eager loading relationship in the model when using eloquent, in this article i'm going to show...
Insert using DB table doesnt update timestamp

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 table,...
How to update timestamp in Laravel

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 laravel migration,...
How to do raw query in Laravel

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 will show...
Laravel query builder example

Laravel query builder example

Instead of hand coding SQL code on your application, you should try to use query builder in laravel, in this article i will show some of the query...
Mass assignment technique in Laravel

Mass assignment technique in Laravel

When you learn about laravel, you probably heard about mass assignment, what does it mean? what exactly is mass assignment? should you care about...
How to add and drop indexes in Laravel schema builder

How to add and drop indexes in Laravel schema builder

On your laravel database migration you can define indexes for each table that you create, for example you can add primary key, unique value, or just...
How to check table column exist or not in Laravel

How to check table column exist or not in Laravel

Besides the 'hasTable' static method, you also have 'hasColumn' method which can check column exist or not on database table of larave...
How to check table exist or not in Laravel

How to check table exist or not in Laravel

Is it possible to check existence of database table in laravel code? the answer is yes, it is possible to check whether a table already exist or not...
Laravel 4.2 schema table column types

Laravel 4.2 schema table column types

These are list of schema table column types that you can use when creating database migration on laravel 4.2, most of these column types also available...
How to exit from php artisan tinker

How to exit from php artisan tinker

Some people having difficulty closing/exit from artisan tinker mode, this is also happened to me when i use artisan tinker for the first time, i don't...
Interact with your application using artisan tinker

Interact with your application using artisan tinker

Another cool feature in laravel is the ability to interact with your application via artisan tinker, using artisan tinker you can execute php code...
How to check Eloquent get() and first() query result

How to check Eloquent get() and first() query result

Every time you run query to the database whether using eloquent get() or first() method, it's always a good idea to check the result of the query...
How to create table seeder in Laravel 4.2

How to create table seeder in Laravel 4.2

Seeding is the technique of filling our database with sample data so we can test and create our applications. It really does make building applications...
Echoing data with default value in Laravel blade

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 not displayed...
What is forelse loops in Laravel blade?

What is forelse loops in Laravel blade?

Besides 'foreach' loops, we also got 'forelse' loops in laravel blade template, what exactly this 'forelse' loops does? and most importantly should...
Looping in Laravel blade template

Looping in Laravel blade template

Just like the 'if' statement, blade also has it's own way of doing loops/looping, you can do 'for' loops, 'foreach', 'forelse', and also 'while' loops....
If statement in Laravel blade template

If statement in Laravel blade template

Blade template have it's own way of doing conditional 'if' statement, the syntax is little bit different from the regular php 'if' statement, but...
How to escape output in Laravel blade

How to escape output in Laravel blade

When you use the blade template in laravel, specially laravel version 4, if you use the double curly braces to output something, then you are vulnerable...
How to create resource controller in Laravel 4.2

How to create resource controller in Laravel 4.2

Laravel 4.2 have predefined resource controller that you can use to start develop CRUD (Create, Read, Update, Delete) based application quickl...
How to pass variable to Laravel view

How to pass variable to Laravel view

Passing parameter/variable to the view in laravel is something easy to do, in this article i will show you how to pass parameter/variable to the...
How to pass parameter to Laravel route

How to pass parameter to Laravel route

In laravel you can pass parameter into the route, the parameter can be pass down to the controller or even the view, you can also add constraint to...
How to create named route in Laravel

How to create named route in Laravel

Another cool feature on laravel is route alias or naming route, using named route you can specify a name for your route, so it is easier for you to...
How to show list of routes in Laravel

How to show list of routes in Laravel

When your laravel application gets bigger, you will end-up having a lot of routes, and it's difficult to maintain, the ability to show list of routes...
Choosing the best text editor for Laravel

Choosing the best text editor for Laravel

There are many choices when it comes to text editor for developing laravel application (or php in general), some people might prefer phpstorm, others...
Changes from Laravel 4 to Laravel 5

Changes from Laravel 4 to Laravel 5

Laravel 5 started life as Laravel 4.3, but was promoted to its own major version when it became apparent that this new version was going to be a radical...
How to change be right back message on Laravel

How to change be right back message on Laravel

When your application is on maintenance mode, it will display 'be right back' message, what if you want to change this message? how to change this...
How to put Laravel in maintenance mode

How to put Laravel in maintenance mode

Did you know that you can put laravel on maintenance mode? this is another cool feature on laravel, you can put your application in maintenance...
Laravel 5.2 directory structure

Laravel 5.2 directory structure

Laravel 5 have completely different directory structure than laravel 4, so if you want to switch your application to laravel 5, you can start by learning...
How to get table prefix in Laravel 4.2

How to get table prefix in Laravel 4.2

On your database configuration (app/config/database.php), you can specify a prefix for every table that you use on your database, the question is...
How to change Whoops, looks like something went wrong error message in Laravel 4.2

How to change Whoops, looks like something went wrong error message in Laravel 4.2

'Whoops, looks like something went wrong', is the dafault error message from laravel, if you turn off the debugging option in laravel. You...
How to enable and disable Debug mode on Laravel 4.2

How to enable and disable Debug mode on Laravel 4.2

One of the cool feature on laravel is that it has debug mode, when you are on development stage, it is always a good idea to enable debugging mode...
Error in exception handler Laravel 4.2

Error in exception handler Laravel 4.2

'Error in exception handler.' is the common error message that you get when setting up laravel project for the first time. The question is how to...

Category

Category