Serverside language we use to build magnificent webapplications. With Laravel, a new era for PHP has come. We love to explain our newest insights on Laravel.

Validation of user input with a request in Laravel: authorization

Posted in PHP on May 19, 2016

Validation of user requests is an essential part of every web application. Part of the validation process is a check whether the user input has the correct format. Is the email address entered by the user really an email address? But there is more. We have to make sure that the user who is doing the request, is actually allowed to do this. With the authorization methods of Laravel, it’s easy to set this up.

Read more

Easy cron jobs in Laravel

Posted in PHP on May 2, 2016

Setting up cron jobs is easy in Laravel, since it has a build-in task scheduler. One of the main advantages of this task scheduler is that you only have to set one cron job in your DirectAdmin/cpanel environment. Once this is done, everything will be handled by Laravel. In this blog we describe how to set a cron job in Laravel.

Read more

Protect your images in Laravel

Posted in PHP on April 18, 2016

For many websites, it’s common to display images that are uploaded by users. Often the images are available to all other visitors of the website, but sometimes you want to protect the image files. For example, you want people to first create an account before they are allowed to view certain content. How can this be achieved in Laravel?

Read more

Laravel’s view composers

Posted in PHP on November 23, 2015

With the view composers of Laravel, it’s easy to extend your master view with dynamic information. For example, your website has a topbar in which you would like to show a message to users that are logged in (welcome firstname lastname) or you want to show the contents of the user’s shopping cart. A view composer provide these possibilities in a very clean way.

Read more

Validation of requests in Laravel

Posted in PHP on November 6, 2015

In most websites or webapplications, users are allowed to fill in some forms of which the data should be stored in a database. For example, if a new order is placed in a webshop, or a new account is created, the data entered by the user should be stored. It’s essential to validate this user input before actually saving it. Laravel has a build-in validator class to make this an easy job.

Read more

Optimizing CRUD operations: inserting data into a database

Posted in PHP on September 25, 2015

In many applications, create-read-update-delete (CRUD) operations are common tasks that are regularly performed. To optimize your workflow and keep your code clean, it is a good idea to generalize these operations. When you build a webapplication from scratch, you likely have written some wrapper functions for this purpose, but when you are using Laravel, a lot of nice features are available out of the box. In this blog, we focus on the creation of new records and the modification of existing ones.

Read more

Namespacing in php

Posted in PHP on August 25, 2015

When an application grows bigger and code gets more involved, chances are that you are accidentally reusing the same function or class name. As a consequence, an error occurs. If you’re using external libraries, you even have a bigger change of creating an error. The solution is to use namespacing and this blog covers an introduction to this topic.

Read more

Tutorial: upgrading to Laravel 5

Posted in PHP on August 17, 2015

Laravel is a wonderful framework for the development of webapplications. It makes programming a lot easier and helps to keep your code clean. In the beginning of 2015, Laravel 5 was released. Although it’s not strictly necessary to upgrade if your application is written in an older version, upgrading is actually quite easy. So why not upgrade and make use of the latest features? This tutorial shows you step by step what to do to upgrade to Laravel 5.

Read more

Passing objects by reference and by value

Posted in PHP on August 5, 2015

When you supply arguments to a function, these arguments will either be passed by value or passed by reference. This seems to be a subtle difference, but it could become a bit frustrating if you don’t know exactly what happens. The key thing to note is that simple variables such as strings, integers and floats are passed by value by default, but objects are passed by reference. If you need to use the object passed by reference, use the clone keyword to make a deep copy!

Read more

Laravel: Framework for the development of webapplications (part 2)

Posted in PHP on December 17, 2014

The second part in the blog series about the php-framework Laravel. Besides a clear model-view-controller structure, Laravel offers great possibilities to quickly perform create, read, update and delete (CRUD) operations. Also for the validation of user input a nice class is available. Because these type of actions are often required in a webapplication, optimizing those actions definitely optimizes your whole workflow.

Read more