PHPNews

Routing to Controllers

It's neat that we can provide a closure to handle any route's logic, however, you might find that for more sizable projects, you'll almost always reach for a …

Written by Laracasts - - Aggregated on Tuesday September 17, 2019


Route Wildcards

Often, you'll need to construct a route that accepts a wildcard value. For example, when viewing a specific post, part of the URI will need to be unique. In …

Written by Laracasts - - Aggregated on Monday September 16, 2019


Pass Request Data to Views

The request() helper function can be used to fetch data from any GET or POST request. In this episode, we'll learn how to fetch data from the query-string, …

Written by Laracasts - - Aggregated on Thursday September 12, 2019


Basic Routing and Views

When I learn a new framework, the first thing I do is figure out how the framework's default splash page is loaded. Let's work through it together. Our first …

Written by Laracasts - - Aggregated on Thursday September 12, 2019


Eloquent Subquery Additions

Laravel 6 ships with improved support for Eloquent subqueries, thanks to a few PRs from Jonathan Reinink. You may now add subqueries by using the new addSelect…

Written by Laracasts - - Aggregated on Wednesday September 11, 2019


Install PHP, MySQL and Composer

Before we get started, you must first ensure that up-to-date versions of both PHP and MySQL are installed and available on your machine. In this episode, we'll …

Written by Laracasts - - Aggregated on Wednesday September 11, 2019


The Laravel Installer

Now that we have Composer setup, we can pull in the Laravel installer and make it accessible globally on our machine. This allows you to run a single command …

Written by Laracasts - - Aggregated on Wednesday September 11, 2019


Laravel Valet Setup

If you're a Mac user, rather than running php artisan serve, you might instead choose to install Laravel Valet. Valet is a blazing fast development environment …

Written by Laracasts - - Aggregated on Wednesday September 11, 2019


Reflect Into Functions

PHP's various reflection classes allow us to do all sorts of magical things. In fact, they're very much the backbone of Laravel's service container logic. In …

Written by Laracasts - - Aggregated on Tuesday September 10, 2019


At a Glance

Before we dig into the nuts and bolts of Laravel, let's first zoom out and discuss what exactly happens when a request comes in.

Written by Laracasts - - Aggregated on Monday September 9, 2019


Lazy Collections

The first stop on our Laravel 6 tour is lazy collections, contributed by Joseph Silber. This is easily one of my favorite additions to Laravel 6. While a …

Written by Laracasts - - Aggregated on Tuesday September 3, 2019


Explain PHP Generators

PHP generators can be confusing to understand. Why and when would I reach for them? The easiest answer to this question is when you're working with very large …

Written by Laracasts - - Aggregated on Monday September 2, 2019


Fetch the Most Popular Authors

Let's begin working through some basic exercises. Using our blogging system, imagine that your boss wants to give a bonus to the ten most popular writers. …

Written by Laracasts - - Aggregated on Tuesday August 27, 2019