Avatar 💻

recca0120 Tech Notes

Software Developer / Tech Notes

  1. Home
  2. Archives
  3. Categories
  4. Tags
  5. Search
  6. About
    1. Dark Mode

Archives

2026 25
2024 3
2023 11
2022 13
2020 15
More

Categories

PHP Laravel Frontend Testing Database DevOps Tools MacOS Windows Python

Tags

Laravel PHP Testing Javascript PHPUnit SQLite Typescript Aws Blade Composer Developer-Tools Guzzle Mockery Sql.js Validation Devops Docker Linux MacOS Migration
Featured image of post Laravel 10 Database Expression: Cross-Database SQL
Laravel Database

Laravel 10 Database Expression: Cross-Database SQL

MySQL's IF() fails on SQLite. Laravel 10's Expression interface generates Grammar-specific SQL, encapsulating cross-database differences into a reusable class.

2023 年 2 月 20 日
正體中文
Laravel MySQL SQLite Testing
Featured image of post Add MySQL Functions to SQLite in Laravel Tests
Laravel Database

Add MySQL Functions to SQLite in Laravel Tests

SQLite throws "no such function" for MySQL-specific functions like FIELD. Use PDO sqliteCreateFunction in TestCase setUp to register them and make tests pass.

2023 年 2 月 17 日
正體中文
Laravel SQLite Testing
Featured image of post Eloquent Macro: Fire Specific Events After saveQuietly
Laravel PHP

Eloquent Macro: Fire Specific Events After saveQuietly

Save a model silently with saveQuietly, then selectively dispatch created or other Eloquent model events via a custom Builder macro fire method in Laravel.

2023 年 1 月 20 日
正體中文
Laravel Eloquent
Featured image of post Fix S3 UnableToCheckFileExistence 403 Error in Laravel
Laravel DevOps

Fix S3 UnableToCheckFileExistence 403 Error in Laravel

Without s3:ListBucket in the IAM policy, S3 returns 403 for missing files, making [Flysystem](https://flysystem.thephpleague.com) throw UnableToCheckFileExistence. Adding the permission resolves it.

2023 年 1 月 19 日
正體中文
Laravel Flysystem Aws
Featured image of post Fix gRPC "Waiting for thread pool to idle" in PHPUnit
PHP Testing

Fix gRPC "Waiting for thread pool to idle" in PHPUnit

PHPUnit prints "Waiting for thread pool to idle before forking" when the gRPC extension is too new. Downgrade grpc to 1.49.0 to eliminate the warning.

2023 年 1 月 18 日
正體中文
PHP PHPUnit
Featured image of post Install Docker CE on WSL2 Without Docker Desktop
DevOps Windows

Install Docker CE on WSL2 Without Docker Desktop

Install Docker CE in WSL2 without Docker Desktop: add your user to the docker group to run without sudo and enable systemd for automatic Docker startup on boot.

2023 年 1 月 15 日
正體中文
Docker WSL2 Linux
Featured image of post How Laravel Facade Resolves Instances from the Container
Laravel PHP

How Laravel Facade Resolves Instances from the Container

Laravel Facade uses getFacadeAccessor to resolve instances from the Container. This post shows the difference between bind and singleton and how custom Facades work.

2023 年 1 月 12 日
正體中文
Laravel PHP
Featured image of post PHPUnit: Mock sleep() in 2 Ways Without Waiting
Testing PHP

PHPUnit: Mock sleep() in 2 Ways Without Waiting

When sleep() slows PHPUnit tests, extract a Clock class and use Mockery spy to replace it, or use php-mock to mock the built-in function with no code changes.

2023 年 1 月 6 日
正體中文
PHP PHPUnit Mockery Testing
Featured image of post Use Laravel Container bind to Inject Any Third-Party Package
Laravel PHP

Use Laravel Container bind to Inject Any Third-Party Package

When a third-party class needs constructor parameters, Laravel cannot auto-resolve it. Register it with bind in a ServiceProvider to enable type-hint injection.

2023 年 1 月 6 日
正體中文
Laravel PHP Composer
Featured image of post Fix macOS PHP NSCFConstantString Fork Error with One Env Var
MacOS PHP

Fix macOS PHP NSCFConstantString Fork Error with One Env Var

macOS artisan tinker throws an NSCFConstantString fork error when Guzzle is used. Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES in ~/.zshrc to fix it permanently.

2022 年 12 月 26 日
正體中文
PHP Guzzle
1 2 3 4 5 6 7
© 2020 - 2026 recca0120 Tech Notes
recca0120 on GitHub
Built with Hugo
Theme Stack designed by Jimmy