Laravel 6 — What’s New?

This month we have witnessed a major release of our favorite PHP framework. Laravel is turning eight this year, and the older it gets, the more we like it. Just like a kid… Not to say we didn’t like it before! 

In this article, I’ll give you a quick run through on the most important changes with this major release. 

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.