Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

What has changed in Laravel 5.5?

Monday, September 18th, 2017 by Servage
laravelA new major version of Laravel is scheduled for release in late August 2017. In addition to being a long-term support release, many new features will be added to the framework, including a new error handler, custom validation rules, a new Artisan command and more. Let’s have a closer look at these new features. The “migrate:fresh” Command In previous versions of Laravel, the migrate:refresh command has been used as a quick way to roll back all changes made to a database. What it does is simply execute the down() method of all migrations followed by the up() method. The new command migrate:fresh does the same but skips calling the down() method first. In many ...

Getting started with Gulp

Thursday, September 14th, 2017 by Servage
gulpGulp is a task runner for JavaScript that can automate away repetitive tasks so you can focus on coding instead. Gulp is an extremely versatile tool that can automate tasks from transpiling SCSS to live reloading with Browsersync. Let’s have a look at some of the most useful tasks you can automate with Gulp and a quick look at how to set it up. Transpiling SCSS Using a CSS preprocessor like Sass is quite common these days, especially when working with front-end frameworks because of how well it integrates with them. Sometimes it can be quite confusing to set up an automated transpiler that converts SCSS to CSS. Gulp makes this possible with ...

CSS grid and the future of Flexbox

Wednesday, September 6th, 2017 by Servage
css-flexboxFlexbox has been around for a while now and we have reached the point where you can safely use it in new projects. Recently, a new similar layout system called CSS Grid has been released. It comes with most of the features from Flexbox and some more. For instance, CSS Grid is a two-dimensional layout system compared to Flexbox which only supports one dimension. This article gives you a basic understanding of the new grid layout as well as the future of Flexbox and CSS Grid. Two Dimensions Flexbox is a one-dimensional layout system. This means it supports either rows or columns but not both. It is possible to created nested containers with ...

Building linked data APIs with API Platform

Saturday, September 2nd, 2017 by Servage
api-platformAPI Platform is a framework for building RESTful APIs using PHP. It’s built on top of Symfony 3, and creating your first RESTful API can be done in just 5 minutes. API Platform is specifically designed for building APIs that utilize linked data, which is often used by libraries, social network websites, online stores and other websites where data is strongly related to other data. Features Briefly API Platform comes with a big collection of features designed to make building APIs using linked data easy. It comes with a CRUD out of the box for create, read, update and delete actions like RESTful APIs usually do. It integrates well with Swagger, a tool ...

Hybrid mobile application with Ionic

Sunday, August 27th, 2017 by Servage
ionicIonic is a framework created with Angular for building cross-platform mobile applications using web technologies. The main language for developing with Ionic is TypeScript, which is based on JavaScript. Ionic allows you to create applications for the most popular mobile operating systems by maintaining only a single code base. Getting Started If you have used Angular before, getting started with Ionic is easy. If not, don’t worry—there’s only a few commands to run and your first project will be up and running. The recommended way to create a new Ionic project is to use the Ionic CLI which is a tool similar to the Angular CLI. It can be used to not only create ...

What does it take to build an API?

Tuesday, August 22nd, 2017 by Servage
api-cloudBuilding a fully functional API consists of multiple pieces that are eventually connected together, such as authentication, integration with external services and the core application logic. In this article we will see what it takes to build a full API and what you should consider when the time comes to build one. Authentication If you application has user accounts, you will need to handle authentication with your API. The first thing you should do is decide how users authenticate. Is it a traditional username and password combination, an API key, or perhaps something more advanced like OAuth 2? Either way, if your application handles login details, you should also set up an SSL ...

Synchronizing files between web servers

Wednesday, August 16th, 2017 by Servage
syncMany applications handle files in a way or another. Support tickets attachments, profile pictures, forum posts and many other features require files to be stored on servers. Often the easiest way is to store them on the filesystem of a web server. If your website consists of multiple web servers, you must send the uploaded files to the other servers as well to keep them synchronized. Here are a few suggestions on how you can achieve that. Sending Files Using FTP FTP is available on most web hosting environments. FTP is simple to use in PHP and supports a wide variety of commands for file handling. Whenever one web server receives a file, you ...

PHP best practices for using Traits and Interfaces

Thursday, August 10th, 2017 by Servage
php-codeDo you often notice yourself ending up writing the same code in multiple files? Do you wish you could force similar classes to follow the same structure? Traits and interfaces are something new PHP developers tend to overlook, but they are perfect in solving problems like these. Traits: An Alternative to Multiple Inheritance Traits have been available in PHP since 5.4. A trait is a PHP file that uses the trait keyword instead of class. Traits and classes are quite similar: classes can be extended and traits can be used inside other classes to prevent having to write same code twice in different files. Instead of writing the same method for two classes, ...

Things that every PHP developer should know

Saturday, August 5th, 2017 by Servage
phpThe PHP ecosystem is relatively simple to keep up-to-date on once you know your way around it. The ecosystem has not changed as significantly as let’s say JavaScript over the past few years. However, there are some concepts every developer should be familiar with, as well as some tools that have become standards in PHP. Let’s have a look at these things you should be familiar with as a PHP developer. Composer Composer is the first thing that comes to the mind of developers when they have to name one great thing about PHP. Composer is a package and dependency manager tool for PHP, and it makes working with external libraries much easier ...

What is Vue.js?

Tuesday, August 1st, 2017 by Servage
vueVue.js is a framework for building interactive user interfaces. It has gained quite a bit of popularity among front-end developers for being easy to use and working well in different types of projects. What is Vue.js more specifically and how does it work? Let’s find out. Vue for Views As the name might suggest, Vue.js is the V in MVC. You can use it to build the view side of your application without worrying about the rest of your technology stack because Vue.js works well with almost any type of back end. Vue utilizes the same approach with a virtual DOM as React, making it fast to render changes on a page. It is ...

Recent articles

Webpack demystified

Webpack is one of the must-know tools for front-end developers who are working with Node.js. Webpack is a module bundler for JavaScript assets. However, it is also capable of doing much more than just that, making it a rather big and complex tool. Let’s clear the confusion around the many features of Webpack by checking what it’s most commonly used for and how it all works. Bundling Files One of the primary features ...

Recover database records with soft deletion

Some websites allow you to delete your content, such as videos you have uploaded or even your whole user account. At least this is what it looks like for the end user. However, in most cases, the content is not actually deleted, which gives administrators an easy way to undo actions of users who make hasty decisions. This can be done using a technique called soft deletion. How Soft Deletion Works Soft deletion ...

Learn about OAUTH

OAuth is an authorization standard that can be found on websites, APIs, web applications built with React or AngularJS and more. OAuth is often used to let other websites access user information on another website. OAuth can be used for various types of authorization, so let’s see how it works in more detail. Why OAuth? As mentioned previously, OAuth gives a website access to a user’s profile information on another website. When you ...

Introduction to Graph Databases

You may have worked with relational databases such as MySQL before, but what about graph databases? Graph databases are data storages for the semantic web, and their structure differs from a typical relational database. Let’s have a closer look at how a database like this works and what it can be used for. Data Storage Model A relational database stores data in key-value pairs in rows of a table where a column (key) ...

CORS explained

Cross-origin resource sharing (CORS) is a feature that allows website content, such as external font files, to be requested between different domains. Although it doesn’t sound very obvious, CORS is used on a majority of websites. Let’s have a look into what CORS is all about and when it is used. Same-Origin Policy Before talking about CORS itself, let’s talk about a security feature related to it called the same-origin policy. It is ...