Create Custom Laravel Helper Methods

Hi All, this is Adi, with another Laravel article. I wanted to take some time to explain what Laravel’s Helper methods are and how you can create your own ones. I was never a big fan of creating my own custom helper methods when I started with Laravel, but with time, I have started using them more often and these days there’s no Laravel project without customer helpers.

Let’s get started.

How to Setup Tailwind CSS With Parcel Bundler

Introduction

Hi all, this is Adi. Today, I wanted to share with you my experience in setting up Tailwind CSS with Parcel Bundler. if this interests you, continue reading.

I am a long time fan of Bootstrap since version 2. I have used it for nearly all my projects. Bootstrap 4 introduced many new utility classes that have made my life a little easier and my markup more readable. But lately, I have been hearing so much about the brand new CSS framework named Tailwind CSS. I am quite confident that you might have heard about it as well. So, I decided to give it a try. I read through their documentation, and it was as though it was made for me... this framework is so generic, it will feel the same for anyone.

Reusing a Controller Method for Multiple Actions in Laravel

Hi all, this is Adi with another Laravel tutorial. This time, I wanted to cover my basic solution to a problem we might all have when building web apps using only blade templates.

Let’s take this example scenario and explore possible solutions. We have an index method on, let’s say UsersController, which lists all the users from our database. Each user has a Subscription and we want to change their subscription. How would you go about doing this with pure blade templates?

How to Set up Automatic DB Backup in Laravel [Snippet]

Automatic DB backup in Laravel

Hi all, this is Adi again with a Laravel-related article. This time in a shorter format. As Laravel developers, we need a way to back up our apps' databases somewhere for both saving/keeping data and for analysis. I want to share with you a simple solution that I have devised for some of my smaller projects. I have tested this method only on MySQL DB and on a VPS, but I think it’s pretty much the same for any database.

You may also like:  Website Backups in 7 Simple Steps

TL;DR

The outline of my solution is as follows. There’s an artisan command that handles the backup and runs periodically using a cron. This command makes use of the mysqldump tool that comes with all MySQL installations. mysqldump dumps the given DB into a .sql and we can control where it is dumped. And that’s how my solution works. Now let’s see some code.

10 Underused Laravel Blade Directives

Laravel Blade is the template engine that’s built into the framework. It makes working with HTML a breeze. I have been working with Laravel for more than a year, but never realized some of Blade’s features. I want to share with you 10 underused blade directives that will clean up your code and save some time in the process. Let’s get going.

Check out LaravelCollections.com - an ever growing collection of great Laravel resources