Tag php

Ultimate guide to Tesseract OCR on Laravel

Optical Character Recognition (OCR) is a technology that enables the extraction of text from images and scanned documents. It’s incredibly useful for automating data entry, text extraction, and more in Laravel applications. Tesseract OCR is an open-source OCR engine that’s…

Yoda conditions

Yoda conditions are a programming style, which goal is to prevent accidental assignments of variables within conditionals. Such as in the following situations. To prevent that, the constant is placed at the forefront of the statement, therefore raising an exception…

Laravel queue supervisor

A laravel queue is an useful tool for a variety of scenarios. It can be used for things ranging from email sending to video compression in background. It’s all in all a good experience, until you have to manage the…

PDF to plain text with OCR

Parsing a PDF document within a laravel application, is not really a problem nowadays. There are multiple packages already made just for that, which could help you achieve any desired functionality to a level of extent. My favourite, like for…

Composer memory limit

Have you ever encountered a situation, where while installing or updating composer packages, it failed? Some of us did, and it’s always frustrating. The reason for that can range from incompatible package versions, to outdated interpreter or lacking system dependencies.…

What are Heredoc and Nowdoc?

Most of the time, using a regular string for large outputs is not the optimal solution, especially if the content is spread across multiple lines. There’re several tricks to achieve the desired result with different levels of cleanliness. Instead of…

PHP Variables in strings

There are several methods to write variables in strings in PHP, but one of the cleanest and apparently the fastest is by using the double-quotes notation. To achieve that wrap the desired variable within curly braces and place that inside…

TIL: stdObject custom string keys

Hi there!For quite some time I’ve been using objects in a wrong way. Every time after a json_decode, I was by inertia casting the returned stdObject into an array to use with some more “special” keys. The ones with special…

TIL: strtotime function

While researching the `setcookie` function, another one caught my eye. Apparently, instead of writing the time of expiration in unix seconds, you can use human-readable format, neatly parsed by strtotime() ! It for sure improves the readability of the code,…

Hello world!

It’s-a me, Dragomir!, a blog about daily findings, curiosities and struggles within the vast world of php development and beyond. The goal of this website is to, bit by bit, improve the speed and comfort of development of readers, by…