Laravel Model Factories provide a convenient way to populate your database with Dummy Data during development as well as provide a way to insert Records while running Tests.

You can create a Model Factory using artisan command make:factory. …

Blade Components have been around Laravel since long, however they gain immense popularity with the release of Jetstream. Jetstream uses Blade Components to keep all the Views consistent and helps to avoid duplicating any Html and thereby keeping the things DRY.

Besides Anonymous Components there are Class Based Components as…

Blade Directives provides a convenient and clean way to display data in View. There are various Blade Directives available like @if, @for, @foreach, while which have similar syntax as their PHP Counterparts. Also, we have slightly more robust Directives like @auth, @guest etc.

It is entirely possible to create your…

How to Create Migrations in Laravel

You can create a migration file using the Laravel make migration command. You need to specify a meaningful filename like below:

If you are creating migration to add a new table, you should pass --create parameter along with table name. …

Route Model Binding

When I first started working with Laravel, one of the very first piece of code that I came across was similar to following:

So when I went to URL /post/1, the Post with…

Saurabh Mahajan

Freelancer Developer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store