Skip to content

Instantly share code, notes, and snippets.

View GeniJaho's full-sized avatar
🏠
Working from home

Geni Jaho GeniJaho

🏠
Working from home
View GitHub Profile
@GeniJaho
GeniJaho / DoNotEagerLoadByDefault.php
Created March 31, 2025 11:03
DoNotEagerLoadByDefault PHPStan rule
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use PhpParser\Node;
use PhpParser\Node\Stmt\Property;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
@GeniJaho
GeniJaho / 5-image-convertion.php
Created November 9, 2021 20:30
5 - Image convertion
<?php
...
private const TEMP_HEIC_STORAGE_DIR = 'app/heic_images/';
protected function convertHeic(UploadedFile $file): \Intervention\Image\Image
{
$extension = $file->getClientOriginalExtension();
// Generating a random filename, and not using the image's