Database First vs Code First MVC frameworks genrally allow the programmer to either auto-generate the Classes from the SQL tables or to auto-generate the SQL tables from the classes. This is called scaffolding. The debate rages as to whether its better to start with a "code first" or a "database first" approach. I am an [...]
Category: Your First Laravel Application
This section describes how to rapidly and simply build your first laravel application
Your First Larvel App - Installing Composer and Creating a Project
There are a couple of different ways of creating a new laravel project - both of them require Composer. Composer, if you're not already familiar with it, is a dependency package management system. If you have some experience developing software it's likely you've come across dependency package management systems before. If this is the case [...]
Getting infyom generator installed and working
As previously discussed Laravel does not come with the ability to scaffold out of the box. Instead we must install an Admin Panel Generator. My review of the Generators available for Laravel was by no means exhaustive. As I mentioned I more interested in the simple core functionality that they offer then all of the [...]
Generating BREAD from an existing Database table
Although Infyom has now been installed. It is set up to use a complicated Admin Panel approach that requires the User to be logged in. As we have not implemented User login yet we need to strip out some of the Boilerplate code used by infyom and replace it with something way simpler. Open the [...]
The Laravel Folder Structure explained
All MVC frameworks have a folder structure which determines the organisation of the various files which make up the application. As the name would imply the most important files within the framework are Models, Views and Controllers. The Laravel Folder Structure is organised as follows [...]
Understanding the Flow - Step 1 - A stripped back Request/Response example
There are a number of standard diagramatic approaches used to represent MVC diagrams. In the most common of these the Models, Views and Controllers are represented as three boxes with the User interacting with the Controller and being presented with information from the view. While this can be a useful way to look at the [...]
Understanding the Flow - Step 2 - Adding a Model Class
In this step we are going to make the customer data save to the database. For this we will need a database table called customer. Execute the following SQL code on your tennisclub database to create a customer table. create table customer ( id int auto_increment, firstname varchar(30), surname varchar(30), primary key(id) ); In a [...]
Understanding the Flow - Step 3 - Passing Data to a View
While a View may need to display and present certain information it is not the View's job to go searching and retrieving information from the Model. The Controller can retrieve whatever information is relevant and pass that data along to the view for presentation. There are a number of typical situations where it is necessary [...]