Skip to main content

All Tutorials

In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.

Tutorial Free

Laravel and shared-hosting: working with FTP and phpMyAdmin

With Laravel, we get used to command line commands like composer install or artisan migrate. But what if we have only shared-hosting from client, with only FTP access and phpMyAdmin to manage database? Laravel is still usable in this case, but there are some tricks you need to make it work.

Tutorial Free

Eloquent: how to make a copy of a row

Today I want to tell you about one "hidden" Laravel feature which is in the system but not in documentation - replicate. This function allows you to make a copy of a row in the fastest way possible.

Tutorial Free

Auth: login with username instead of email

Laravel comes with out-of-the-box authorization mechanism which is incredibly easy to use. But it depends on several pre-defined things, one of the main ones - DB table **users** structure and login with **email** field. What if you want to have **username** to identify a user?

Tutorial Free

Limit failed login attempts on Laravel Auth

Did you know that Laravel Auth system allows you to block the user after X bad attempts to log in? Even more, you can change that limit! This trick works with out of the box Laravel Auth system and all you have to do is modify one file.

Tutorial Free

Laravel-datatables: enchant your tables with ease

Today I want to offer you an overview of a package made for DataTables.net integration into Laravel: laravel-datatables. This package allows you to easily create server-side processed DataTables with most of its available functionality while only writing a few lines of code.

Tutorial Free

Laravel Schema Designer - prepare your database visually

Laravel has a great mechanism of migrations, but what if you want to visualize your DB schema to see all in one place - to discuss with colleagues, for example. There is a great tool for that - here's a brief overview of Laravel Schema Designer.

Tutorial Free

Migration index too long? Choose the name yourself!

Migrations are a great way of building database schema, but sometimes it's harder to deal with more than just columns. One of more interesting things are indexes. In particular, I had a problem of auto-assigning a name to unique index, which appeared to be too long. What to do with it?

Tutorial Free

Quick dropdowns: selectRange, selectYear, selectMonth

Today I want to share a small trick which I've found out only recently. Let's say you need to have a select dropdown field with number range from X to Y - for example, birth year from 1900 to 2015. How would you do it?

Tutorial Free

Select with DB::raw() - make your database work

When selecting data form the database, sometimes you need to make some extra filtering with results - with some if-else statements and similar. With Laravel - you can achieve that with Accessor fields or just looping through results in PHP. But there is a more effective way - to move the filters to the database query itself.

Tutorial Free

Process big DB table with chunk() method

Let's imagine the situation: you have a big database table (like 10 000 rows or bigger) and you need to run an update to one column. But you cannot run just SQL query - there is some PHP logic behind it. So foreach loop could potentially take forever or bump into a default 30-second script limit. Luckily, Laravel has a neat solution for it.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.