Posts in category: Laravel Framework

Laravel Framework | PHP & MySQL | Tutorials

Laravel Importing SQL dumps with seeds

Seeding with Laravel is really useful for populating the database for instance a typical u...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel apply a query constraint with global scopes

Imagine your building a multi-tenancy application, in your controller your using a Contacts model ev...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel set default value for creating model instances

Often when creating records with the ORM you'll set the same keys every time, in this cases you...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel storing mailables

Laravel's Mailable emails are perfect for sending rich HTML emails, there are times when you nee...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel retrieving records in a random order

Retrieving records in a random order is simple with MySQL using the RAND() function but it's not...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel show zeros when using zerofill in Eloquent

When using Eloquent leading zeros are removed from integers data types. This is a problem when you w...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel login as user without their password

There are times you want to log in as another user to test their user permissions, you'll want t...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel add custom exception handling

Laravel comes with support for many types of exceptions, some are handled to load a 404 page others...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel add login throttling with custom login controller

When using a custom login controller by default it won't have the login throttling applied.

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Create an XML sitemap

Creating xml sitemaps are great for Google to inform their search bots of all your pages and th...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel create an RSS reed

In this post, I'll explain how to create an RSS feed, In your controller query a model, in this...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel get previous and next record

A really common task is to display links for the previous and next record typically you find these o...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel force https with url helper

using the url() helper is great for creating full http links, I use this for all links, when wo...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel blade - Remove the last comma from array

Using the $loop variable inside of a loop it’s easy to check when you're at the start or t...

David Carr


Laravel Framework | PHP & MySQL | Tutorials

Laravel 5.5 change public to public_html

When moving Laravel onto a production server I like to place all Laravel files in their own director...

David Carr


Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.