Latest Updates

Documenting code, one commit at a time.

Enhancing GitHub OAuth Flow: Preserving User Permissions

Introduction

This article discusses a common issue in applications using GitHub OAuth for authentication: inadvertently overwriting a user's existing token with one that has fewer permissions. We'll explore how to ensure the application preserves the user's original, broader-scoped token when requesting narrower scopes during subsequent logins.

The Problem

Many applications use GitHub

Read more

Enhancements to Cache Handling and Code Robustness

Introduction

Recent commits to our application focused on improving the reliability and efficiency of our caching mechanisms, as well as enhancing the overall robustness of the codebase. These changes aim to prevent race conditions and reduce the risk of errors during refactoring.

Atomic Cache Operations

A key improvement involves replacing Cache::has and Cache::put with the atomic

Read more

Automating Development Tasks with Custom Skills

In software development, repetitive tasks can consume valuable time and introduce inconsistencies. Automating these tasks not only boosts efficiency but also enhances code quality and maintainability. This post explores how custom skills can be leveraged to streamline project workflows, focusing on practical examples and benefits.

Custom Skills for Enhanced Productivity

Custom skills are

Read more
PHP Laravel MySQL

Fixing Type Errors in Subscription Models

When working with custom models that extend core framework functionalities, it's crucial to maintain type compatibility. A recent fix in our application addressed a TypeError that arose from an incorrect extension of the Subscription model.

The Problem: Type Hint Mismatch

The custom Subscription model was initially set up to extend Eloquent's Model directly.

Read more

Improving Data Accuracy with Enhanced API Integration

Introduction

This post details an enhancement to our application's data aggregation process. We addressed an issue where total counts were inaccurate by switching from a local database to an external API for data retrieval, ensuring more reliable results.

The Problem: Data Discrepancies

Previously, our application relied on a local database table, populated with data from an events API,

Read more

Improving API Rate Limit Detection: A Percentage-Based Approach

When interacting with external APIs, especially those with rate limits, it's crucial to implement robust detection mechanisms to prevent service disruptions and ensure smooth operation. A recent adjustment in our application focused on refining the rate limit detection for the GitHub Search API, highlighting the importance of adaptable strategies.

The Problem with Fixed Thresholds

Read more
PHP Laravel OOP

Extending Models with Method Overrides: A Case Study

Sometimes, the core functionality of a framework needs a little customization to perfectly fit the nuances of a specific application. Recently, we faced a situation where we needed to extend our Tenant model to directly handle subscription checks, which required overriding some core Cashier methods.

The Challenge

Our application uses a multi-tenant architecture. Each tenant needs to manage

Read more

Adding Full-Text Search to Your Portfolio with PostgreSQL

Implementing full-text search can significantly enhance the user experience of your portfolio or blog. This post details how to add PostgreSQL-powered full-text search to a Laravel application, focusing on accent-insensitive prefix searching across multiple fields.

The Problem: Basic Search Limitations

Simple LIKE queries in SQL often fall short when dealing with complex search

Read more

Fixing Silent GitHub Scope Update Failures

When integrating with GitHub, users sometimes encounter issues when updating the granted permissions (scopes). A recent update addresses a scenario where these updates would silently fail, leaving users confused.

The Problem

When a user attempted to update their GitHub scope (e.g., from public-only access to all repositories) via the integrations page, a failure in the Socialite OAuth

Read more
PHP MySQL Laravel

Code Formatting and Database Schema Updates

Overview

Recent development activity focused on code style consistency and updates to the database schema.

Code Formatting

Applied automated formatting fixes using php-cs-fixer. This ensures consistent code style across the project, improving readability and maintainability. The tool automatically adjusts spacing, indentation, and other stylistic elements according to predefined rules.

Read more