Calendars are a very important and useful feature of many modern web-based applications. Every time we want to book a trip or an event we need to check the available dates to see which one suits us. This inevitably means having the information presented in some kind of Calendar format. We could write code to [...]
Category: Integrating Components
This section describes how to integrate third party components and plugins into your application
Adding Fullcalendar to your application with Laravel Mix
***important - Do not attempt to complete the following blog post without first having set up npm and laravel mix. A good description of how to do this is in this post https://www.learnlaravel.net/953/adding-a-star-rating-system-to-your-application-step-4-adding-the-star-rating-component/.*** Once you are using Laravel mix to keep your plugins organised you will want to use it everywhere. Earlier we demonstrated an [...]
Getting Json Events
This Calendar uses the json format to list events. If we want it to display tennisClub bookings then we our system to be able to produce events in the json format. The calendar also needs to have specific field names for our json "events" - these include id, title, start, end, and venue. The start [...]
Adding a Modal Form to Create new bookings
Now that we have a calendar it would be nice to use it to create new bookings on timeslots which are available. To do this we need a bootstrap modal form. A modal form is a kind of popup dialog box which pops up in front of your webpage and stays present until it has [...]
Adding a Star Rating system to your application - Step 1 - Generating BREAD for Star Ratings
Many modern web-based software application are heavily dependent on star rating systems. In a typical scenario users in an online marketplace for a product or service have the ability to rate the product, service or their experience. As more and more ratings are added the "wisdom of the crowd" takes over. Where there are many [...]
Adding a Star Rating system to your spplication - Step 2 - Putting the Foreign Key in the Flow
When building a system based on a reltional database developers are challenged to deal with all the foreign keys. In the Getting Started section we scaffolded the bookings table and auto-generated the create.blade.php view which allowed us to create new bookings. The challenge with this screen is, with two foreign keys, it led to confusion [...]
Adding a Star Rating system to your application - Step 3 - Selecting which Court to Rate
On the courts page where there is a list of courts there are a number of things we can do each court. So far these options include show, edit and delete. These options work by passing the courtid selected by the user to the through the url to the relevant controller function. The respective controller [...]
Adding a Star Rating system to your application - Step 4 - Adding the Star Rating component
When we first contructed our Laravel tennis club application we used Composer the PHP dependency package management system. This downloaded Laravel and a whole range of third party packages on which Laravel depends. We then added the Infyom generator, and the packages on which depends - also using Composer. Later when we used FullCalendar, the [...]
Adding a Star Rating system to your application – Step 5 – Changing the View to use the CSS Star Rating component
The next step is straight forward. We need to modify the ratecourt view to replace the simple number based rating with our new bootstrap-star-rating component. To do this, open the file resources/views/courtratings/ratecourt_fields.blade.php and replace the blade helper which creates the rating field with the following line {!! Form::number('rating', null, ['class' => 'rating', 'data-min' => 0, [...]
Adding a Star Rating system to your application – Step 6 - Viewing an average of all ratings submitted
Laravel Eloquent provides a range useful functions that operate over Collections. Collections are basically a more sophisticated version of an array of object with a range of additional features which allow you to query, filter and control the results. Some useful functions can be found here https://laravel.com/docs/6.x/collections#available-methods. One of these methods provides an ability to [...]