Initializing Connectivity

Great software

begins with

clear thinking.

01 2024 // Journal
Jun 06

Securing Your Files: How to Implement Private File Storage and Authorization in Laravel

In this tutorial, we will delve into the process of achieving this level of file security using the powerful Spatie media library within the Laravel framework. We will explore the steps required to ensure that files are stored privately and can only be retrieved by authorized users. By the end of this tutorial, you will possess a comprehensive understanding of how to implement robust file protection and access controls in your Laravel applications, enhancing data confidentiality and user security.

Read Entry
02 2023 // Journal
Mar 16

How to Add Translatable Enum Options in Laravel

This article explores a solution for displaying enum values in a translatable format in Laravel. Enums in Laravel are useful in defining a fixed set of values, but they don't provide a built-in way to display those values in different languages. I'll show you how to create translatable string values for enums and retrieve them easily. I'll also demonstrate how to simplify this process using an interface and a trait. With this approach, you can easily display enum values in any language supported by your Laravel app.

Read Entry
Mar 06

Adding a Custom Open Graph Image to Posts

This article shows you how to use a package to create custom Open Graph images for your Laravel-backed blog posts. By following our guide, you can enhance your website's visual appeal and shareability on social media. This is ideal for bloggers, developers, and website owners looking to increase their online presence and visibility.

Read Entry
Feb 03

Laravel: Customizing Route Binding Logic

In Laravel, customizing route model binding allows you to add custom logic to the process of retrieving a model based on its ID. This article demonstrates how to use a custom parameter and the bind method to guarantee that visitors cannot access an unpublished post. Clear code examples are provided to help implement this solution.

Read Entry
03 2022 // Journal
Aug 11

Style Your Command Outputs The Laravel Way

Yesterday I was going through a command written by one of my colleague to help us seed permissions in an easier way. I was going to add it to our office Laravel skeleton (Laravel with extra functionality to make our life easier). Just I was about to add it, I thought why not use same styling used by Laravel to style the command output. So I dug into Laravel’s code.

Read Entry
Apr 23

Eloquent: One To One Relationships

One to one is a very simple relationship but often not used. So time to time you may need to refer to documentation or google it to understand the relationship better. So here is my effort to make your life a little bit easier.

Read Entry
04 2021 // Journal
Oct 25

Consider an intermediate level refactor

Your file structure is growing. It is not big enough to go DDD yet, neither small enough to follow default Laravel structure. What will you do?

Read Entry
Feb 20

How to implement model states using spaties laravel model state package

Sometimes handling the status of a given record is a pain. You may need to fire events, check if the model can change to the desired status or if the user is authorized to make the change and lot more. In this post, I will be covering a spatie package to help solve this issue.

Read Entry