Servage Magazine

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

Archive for November, 2015

Work with databases and the query builder in Laravel

Monday, November 30th, 2015 by Servage
database-queryWorking with database driven applications in Laravel is super straightforward. This functionality has been included as a core feature of the framework as database handling is almost done in every project. Using your Servage hosting account you can connect to one or multiple MySQL databases from Laravel and create, edit and delete data as you please. This article will outline some of the standard functionality for this. Configuration You first need to configure your Laravel installation for your environment. Note that you can use local configurations to make the database settings different depending on for example local development environment and production web hosting account. Below you find an example configuration. 'mysql' => [ ...

Choosing between responsive and adaptive design

Friday, November 27th, 2015 by Servage
responsive-adaptible-designWhen building a website today there is almost no question about if it should be made responsive or not. It makes sense to adapt websites to the device they are being used on, and thereby improve the user's experience significantly. However, as soon as you begin discussing how you want to adapt the site to different devices and how that responsiveness should actually be implemented, then you run into some general decisions you need to make. Now, responsive and adaptable are different things. It is important to understand the difference because it makes you able to consciously choose the method that is best for your given scenario. Note that responsive and adaptable are ...

Using session data in Laravel

Tuesday, November 24th, 2015 by Servage
session-dataThe session is a system whereby your server can store and retrieve information for a given user. Technically it works by generating a unique session id for each new session and whatever is stored in the session is then actually stored on the server. The user's browser receives a cookie with the session id, and thereby the server knows which user belongs to which session data. Note how the European Union has imposed regulations on how website owners are required to inform users about the usage of cookies. This comes as a reaction to major data aggregation and privacy discussions with impact on almost any website owner. At least anyone who uses ...

Iterations in a design process

Friday, November 20th, 2015 by Servage
design-iterationsWhen working with the design process of a website you go through a series of steps before reaching the final goal. This process may seem apparently random but usually goes trough the same workflow every time. Learning about this process and understanding the workflow is key to improving both the steps on the way, but more importantly the final result, the website itself. The beginning Usually the need for design work comes from a desire to build something new or improve something existing. In the web world this would likely be to build a new website for a purpose you do not have a website for yet. I.e. a new product or maybe even ...

Pagination with Laravel

Tuesday, November 17th, 2015 by Servage
pagination-tableIn a recent article the concept behind pagination was described. It is a useful technique to overcome information overload and can fortunately be easily implemented into existing projects. Some frameworks actually have pagination right in their core functionality. In this article it will be demonstrated using Laravel. Controller pagination example The example below fetches all products from the database with respect to the current pagination settings. The paginate command states that 10 items should be fetched per page, while the page number would come from URL parameters. class ProductsController extends Controller { /** * Show all of the products * * ...

The logic of Angular JS web applications

Saturday, November 7th, 2015 by Servage
angularMany developers new to Angular JS (or client-side Javascript development in general) are often struggling a bit with the understanding of the conceptual logic behind the development workflow and how things work together. Especially developers used to traditional server-side rendering will have to completely change their mindset. API-based The first thing to really understand is that client-side Javascript development is essentially an API-based development, because you are building a stand-alone Javascript application for the browser, which relies on data endpoints on your server. Essentially this is the same way of thinking when building native apps, or any other integrations. Forget about a traditional request which triggers a server-side script, which then renders and returns a ...

Show paginated results on your website

Wednesday, November 4th, 2015 by Servage
paginationPagination means dividing larger result sets into multiple pages instead of having one very long list on a single page. It is used widely to make web pages more comprehensible and to allow better load times. Pagination improves performance for such large result sets both on the server back end and client front end. The database needs to load less results, the server needs to transmit less data via the HTTP response, and the client browser needs to handle and render less HTML. Therefore pagination is an overall improvement to large lists, and should be integrated from the beginning for any type of data that could potentially span over many rows. How ...