The Blog

Laravel

Laravel 4: Be Careful With Your After Filters

John Koster
John Koster
April 4, 2014

Learn how to use the after filter in Laravel 4 to perform tasks after your routes and controllers have run. This filter can be used for various purposes, such as logging or checking specific conditions. By using the after filter, you can manipulate the response content before it is sent to the client. However, if you are working with views and want to avoid potential issues with nested queries being executed twice, it is recommended to use the getContent() function instead of casting the view object to a string.

Servers

How Does PHP Work With The Web Server And Browser?

John Koster
John Koster
April 2, 2014

A large amount of web sites and applications are powered by PHP; therefore an understanding of the PHP language is mandatory to fully understand and accept the ...

Laravel

Laravel 4: Working With Checkboxes and Input

John Koster
John Koster
April 1, 2014

Learn how to create a checkbox in a Blade view using the Form class in Laravel. You can check if a checkbox is checked in a controller by using an if statement. Ensure the checked state of the checkbox is set by passing a boolean value as the third argument in the checkbox function. You can also use Input::old() to set the checked state based on the previous input.

Laravel

Laravel: Calling Artisan Commands From Your Application

John Koster
John Koster
March 27, 2014

Learn how to run Artisan commands from within your application's code with this helpful tip. You can use the Artisan::call method to execute commands, and even pass command options as arguments. Keep in mind that when calling commands from your application, the paths are relative to the location of the calling file. You can simplify path management by using Laravel's path helper functions.

Laravel

Laravel 4: Default Events

John Koster
John Koster
March 25, 2014

Laravel 4 provides a variety of events that are fired throughout your application's life cycle, such as auth.attempt, auth.login, auth.logout, and more. These events are called in specific files like /Illuminate/Auth/Guard.php and /Illuminate/Database/Connection.php. You can find where an event is called or explore available events in this quick reference. Keep an eye on this page for updates and additional event information.

Microsoft/Windows

Modifying the Windows Hosts File

John Koster
John Koster
March 6, 2014

This post will explain how to modify the hosts file on a Windows machine (this post will work for Windows Vista and newer). There are a few different reasons ...

Laravel

Laravel 4: Getting User Input

John Koster
John Koster
November 2, 2013

Learn how to get input from users in Laravel 4 using the Input facade. Find out how to get the value of a specific input element by name, and how to specify a default value if the input is empty. Additionally, discover how to get all of the input values as an associative array using the all() method. Learn how to handle ambiguous input when there are variables with the same name in both a POST request and a URL query parameter. Finally, see how to specify the source of the data you want using the instance() method and access the POST and query data directly.

Laravel

Laravel 4: Rendering a View to a String

John Koster
John Koster
October 31, 2013

Laravel 4 provides a way to separate controllers and business logic from the presentation layer through its Views feature. Instead of outputting a view directly to the client, you can render it into a local variable. This is especially useful when you need to further process the view as a string, such as generating a PDF of the web page. Laravel 4's View::make()->render() method allows you to accomplish this.

Laravel

Getting the Environment Name in Laravel 4

John Koster
John Koster
October 29, 2013

Learn how to use environments in Laravel 4 to develop your application in a way that responds to its running environment. Environments allow for automatic changes to database servers and cache drivers. Check the current environment in your code using the App::environment() method and perform different actions based on the result.

PHP

Passing Data to PHP Anonymous Functions

John Koster
John Koster
October 29, 2013

PHP version 5.3 introduced a new feature called anonymous functions, or lambda functions. They allow for greater flexibility and offer a clean, expressive ...

Latest posts

That Escalated Quickly: All the New Things

The past six months or so have been incredibly busy. What started as a new article series about cust...

Read more
Troubleshooting a Statamic Illegal Offset Type Error when Viewing Collection Entries in the Control Panel

In this post I talk about how I resolved a mysterious illegal offset type error when viewing collect...

Read more
Creating Simple HTTP Redirect Routes from a Statamic Site

Generating a custom Laravel routes file from a Statamic website to redirect to a new domain.

Read more
Disabling Vite File Hashes

Disabling file hashes in Vite output can be accomplished by modifying your project's vite.config.js

Read more
Implementing a Custom Laravel Blade Precompiler for Volt and Livewire

Learn how to implement a custom component compiler for Laravel's Blade templating language in this p...

Read more
Creating a Hybrid Cache System for Statamic: Part Five

Part 5 of 6 covers implementing a cache namespace and labeling system, which we can use to target mu...

Read more