Search the LaraBrain
The Latest LaraBrain Tips

Determining the size in megabytes of a MySQL table

Calculate the size of a MySQL table using a simple query

Committed to the LaraBrain by: wjgilmore at December 12, 2016 6:46 pm

Database

Selectively Enabling Middleware in a Laravel Lumen Unit Test

It's typical to disable middleware when running tests, but what if you want to selectively enable it?

Committed to the LaraBrain by: wjgilmore at July 28, 2016 4:37 pm

Testing

Disabling Middleware in Lumen Tests

Lumen doesn't support the testing middleware trait, but there's another way to disable middleware in your tests

Committed to the LaraBrain by: wjgilmore at July 11, 2016 8:36 pm

Testing

Localizing Faker in Laravel

Faker supports a wide variety of locales, but en_GB is the default. So how can you change this in your Laravel application?

Committed to the LaraBrain by: wjgilmore at July 11, 2016 6:48 pm

Testing

Excluding Multiple PHPUnit Groups

Using groups and a PHPUnit option you can wield total control over which test suites are executed

Committed to the LaraBrain by: wjgilmore at June 24, 2016 2:24 pm

Testing

Passing GET Parameters When Using Laravel Pagination

To paginate search results you'll need to tell Laravel to pass the search parameters from one page to the next

Committed to the LaraBrain by: wjgilmore at June 23, 2016 7:22 pm

Blade Eloquent Views

Determining if a Laravel User is Authenticated

Laravel application users often must be authenticated before access is granted to certain site features

Committed to the LaraBrain by: wjgilmore at May 10, 2016 4:25 pm

Authentication Forms Views

Forcing Laravel to Treat a Database Column as a Date

Laravel will automatically treat user-defined timestamps as dates however there is an easy fix

Committed to the LaraBrain by: wjgilmore at March 9, 2016 2:43 pm

Database Eloquent Views

Retrieving Laravel's Current Database Name

When troubleshooting database connectivity it can be useful to log the current database name

Committed to the LaraBrain by: wjgilmore at March 8, 2016 4:16 pm

Database Debugging Testing

Dynamically Generating a Month Form Field and Setting a Default Value

Small visual cues can help users complete a form faster and with fewer errors

Committed to the LaraBrain by: wjgilmore at March 7, 2016 2:46 pm

Forms

Installing a Composer Package Only in Development Environment

There are plenty of useful PHP packages, however you'll often only want to install theml in your development environment

Committed to the LaraBrain by: wjgilmore at February 14, 2016 8:53 pm

Debugging Deployment Testing

Passing Arguments to Laravel's Artisan::call method

Pass arguments to Artisan::call is possible but the proper approach is not obvious

Committed to the LaraBrain by: wjgilmore at February 8, 2016 4:41 pm

Testing

Changing a Laravel Model's Default Table Name

Somtimes you need to override Laravel's default table naming convention. This short post shows you how.

Committed to the LaraBrain by: wjgilmore at January 26, 2016 4:58 pm

Database Eloquent

Converting a Laravel Collection to an Array

This tip shows you how to convert a Laravel collection into an array

Committed to the LaraBrain by: wjgilmore at January 25, 2016 4:22 pm

Database Eloquent Forms

Return to previous page

Easily return to the previous page by a simple URL helper

Committed to the LaraBrain by: snapey at January 3, 2016 1:27 am

Blade Routing Views

Sanitizing Form Data Before Validating in a Laravel 5 Form Request

Sometimes submitted data requires a bit of additional work prior to validation

Committed to the LaraBrain by: wjgilmore at December 8, 2015 7:22 pm

Forms

Executing Artisan's serve Command Using a Specific Port

To access your Laravel development site on an internal network you'll need to specify a port

Committed to the LaraBrain by: wjgilmore at November 23, 2015 11:41 am

Testing

Different solutions for ensuring a Laravel user is authenticated

Laravel offers a number of different solutions for determining whether a user is authenticated

Committed to the LaraBrain by: wjgilmore at November 13, 2015 2:09 pm

Authentication Forms

Selectively Disabling the Laravel Debugbar

The Laravel Debugbar is an indispensable tool, but sometimes you need to disable it for certain controllers

Committed to the LaraBrain by: wjgilmore at November 12, 2015 4:32 pm

Debugging

Debugging Laravel migrations using verbose output

By increasing verbosity you can easily identify a broken migration

Committed to the LaraBrain by: wjgilmore at November 12, 2015 3:33 pm

Database Debugging