Global Query Scopes And Pagination

Global Query Scopes And Pagination

In this tutorial, we’ll talk about Global Query Scopes and Pagination among other topics. First off, we’ll make some adjustments to the current view file that displays a single thread. Right now the content is centered in a one column style layout. We will modify this to a two column layout with the main content on the left hand side. We’ll then add a smaller right hand column, and then start adding some basic meta type information that might be helpful to the user of the application.…

How To Refactor Code To A Dedicated Class

How To Refactor With PHPStorm

In this tutorial we are going to learn all about how to refactor with PHP Storm. During the course of building our application, we often find the methods in our controllers begin to expand in size. As the need to apply more and more logic happens, we don’t want to see our methods get so convoluted that they become hard to read and reason about. In this tutorial, we’ll try our hand at refactoring some code to make it more pleasant to read and work with in the controller, while still maintaining the same functionality of the application.…

How To Filter Via Query Strings

How To Filter Via Query Strings

This tutorial will focus on adding the ability to filter by query strings when fetching information from the database. There are a few other ways you could do this type of filtering, but many times a simple query string is a nice way to go about it. We’ll start by running all of our tests, and fixing anything that might have gone wrong. Once that is taken care of, we can move on to adding a new feature test to support our new feature of filtering threads by query string.…

How To Use View Composers

How To Use View Composers

In this tutorial we will learn how to use view composers in our little forum application. View composers are a way to make sure certain data is available to view files no matter which endpoint you may be visiting in an application. We’ll discuss placing sql queries in view files, vs having them in a controller, vs making use of view composers. As a little bonus, we’ll also cover how to automatically import a class in PHP Storm.…

How To Remember Form Data

How to remember the form data

We’re actually going to cover a lot of odds and ends with regard to the form that allows a user to create a new thread in this tutorial. We’ll just go ahead and call the post, “How To Remember Form Data” since that is my favorite feature we’ll cover in the following examples. First off though, we’ll add a link so that users can click right over to the form where they can create a new thread.…