Posts

Showing posts from November, 2020

3 => Modelling The Applications Data

Image
Before attempting to do any development work it will be helpful to understand the requirements of the application in terms of the data it will need to function. This blog entry will provide an overview of how the data are planned to be organised. Creating The Models Now that the datas layout and relationships have been defined I can continue forward, figuring out how Eloquent ORM models work. First I have got to set my relationships in my model, to do this we use one of the built in Eloquent ORM methods. The type of relationship will dictate which function is used. All of my models boilerplate code was generated using the following Artisan command.  The -c flag at the end creates a controller for the model as well, reducing the amount of code I am required to write when it comes to managing the controllers logic. User Relationships Each user can have multiple boards Each user can have one custom avatar ( if not the default is used ) Board Relationships Each board must belong to one...

2 => Tooling

Image
Personally I use Visual Studio Code as it has an excellent extension library that appears to have an extension for almost everything due to its strong community. In this entry I am going to cover some of the extensions and tools I've found most useful throughout my time developing my project. Artisan This is not technically an extension or plugin but I feel it is worth covering due to its usefulness. If you have used Laravel before you will already know how useful Artisan is. Artisan is an excellent assistive tool for developing Laravel applications, it can be used for generating boilerplate code, controlling database migrations, creating models, accessing Tinker - a PHP CLI playground - and a range of other uses.  Artisan takes a lot of the work developers normally have to do manually and will do it automatically, all that is required is for the developer to understand where and when to use it. The help functions are also extremely useful and clear while being terse making it fast...

4 => Views - Templates, Components & Pagination

Image
This blog entry will discuss views, more specifically Blade Templates, and how I implemented pagination. The creation of views, templates and dynamically rendering content for the client will be covered throughout this entry. I'll also discuss some of the problems I faced while attempting to use views and how I overcame those problems. Views In its most basic description, views are what the customer is served, it is the HTML page that the customer interacts with on their client. Laravels Blade files provide functionality that vanilla php can provide however it provides a consistent and straightforward method in doing so. An example of this is @foreach loops and the displaying of error messages using @error. Laravel allows for views to be constructed in several ways. Vanilla php ( You are not forced to use .blade.php files ) Laravel Blade templates Plain HTML ( Doing this you lose most of the functionality php provides however if a page is static and the content never changes this i...