Category Laravel

Laravel’s `chunkById`

So I started a new job at the beginning of the month. While I’m learning a lot, at the same time, it’s familiar because it’s mainly Laravel. At the same time, I’m always learning new gotchas with Laravel as well.…

Laravel mix image processing

Before Laravel 5(ish), people used gulp to minimize/refresh images. It just came with it and was easy to implement. Now with Laravel Mix, you have to install a few npm packages in order to have the image compression that gulp…

Laravel 5.4 migrations & max key length

I’ve recently switched to a Laravel 5.4 project. After trying to run migrations, I kept getting this darn error:  [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes It made no…

Orderby if null

I'm posting about this today because I feel like this is a very not well known little mySql knowledge and it really saved me. I've got an employee table that has a first name, last name AND nickname.

Laravel’s Eloquent and firstOrNew

Hey everyone! This is yet another web dev post and this is gonna be quick and dirty.. It’s regarding Laravel and the Eloquent’s firstOrNew. firstOrNew is like firstOrCreate, but instead of creating an instance in the database, it just retrieves…