Skip to main content

All Tutorials

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

Tutorial Free

Don't forget to use Carbon constants

When working with dates and times, we use awesome Carbon class, right? And there's a lot of small things in it which we might not even know. I will give you one example today.

Tutorial Free

Three new features in Laravel 5.2.22

Two days ago Taylor Otwell released a new minor version of Laravel framework - 5.2.22. Along with some small fixes, there are a few new functions, let's look into them.

Tutorial Free

Holywar: when to use Laravel vs WordPress?

In PHP world there are two big groups of developers - those who work with Content Management Systems (WordPress, Drupal etc.) and those with frameworks (Laravel, Symfony etc.). And rarely people work with both worlds - cause their philosophy is fundamentally different. But when you get a new project from a client - how to decide whether Laraver is the best choice? Or maybe simple WordPress would be enough and would save time/money? Sometimes it's not that easy to decide. So here are my tips - questions you need to ask.

Tutorial Free

A "hidden" way to drop foreign keys in migrations

If we add a foreign key column in our migration file in function up(), we need to make sure that foreign key would be dropped in down() function, right? The thing is that you need to remember longer foreign key name to drop it by name. What official Laravel documentation doesn't say is that there's a more convenient way.

Tutorial Free

Caffeine Package - prevent forms from timing out

If you have a longer form in your project, it takes time to fill it in. And if it's hidden under user session, it will time out - by default, in 120 minutes. Seems like enough time, but what if a user left the form open for longer time, went for coffee or something, and then tries to finish it after a while? There is a package to make session active.

Tutorial Free

Resource Controller Delete: link instead of a button?

Laravel has Resource Controllers which allow us to quickly set up create/read/update/delete operations. But the trickiest one is probably DELETE one - we have to create a separate form for it. With submit button. What if in our table Delete is not a button, but a link? An icon with a link on it. Here's how to get the whole thing working with link instead of a button.

Tutorial Free

Migrate "pretend" - view actual SQL queries before you run them

Laravel has convenient database migrations mechanism, which allows us to track database changes and easily roll them back if needed. But what is hiding behind the scenes? What if we need to know actual SQL queries that have been generated during the migration? Or another scenario - what if we want to check the SQLs before they are actually run? There's a trick for both of 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.