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 49
2024 3
2023 11
2022 13
2020 15
More

Categories

PHP Laravel Testing Frontend DevOps Database Tools Python AI MacOS

Tags

Laravel Php Testing Javascript PHPUnit Sqlite Python Typescript Ai-Agent Claude-Code Composer Linux Aws Blade Developer-Tools Devops Docker Guzzle MCP Mockery
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
Featured image of post Pass Python Requests to PHP via PSR-7 Message Format
PHP

Pass Python Requests to PHP via PSR-7 Message Format

Have Python output HTTP responses as PSR-7 message strings and parse them in PHP with Message::parseResponse — no manual header or body splitting needed.

2022 年 12 月 26 日
正體中文
Php PSR-7 Guzzle Symfony
Featured image of post Speed Up Laravel Tests 7x with PDO::exec Schema Load
Laravel Testing

Speed Up Laravel Tests 7x with PDO::exec Schema Load

Load schema dump into SQLite in-memory database via PDO::exec, skipping per-file migrations. Cuts Laravel test time from 2:21 minutes down to 18 seconds.

2022 年 12 月 19 日
正體中文
Laravel Sqlite Testing Migration
Featured image of post Fix Laravel Migration Unknown Database Type Enum Error
Laravel Database

Fix Laravel Migration Unknown Database Type Enum Error

Doctrine DBAL does not recognize MySQL enum type, causing migration failures. Covers Type::addType and registerDoctrineTypeMapping with when to use each fix.

2022 年 12 月 13 日
正體中文
Laravel Migration MySQL
Featured image of post PHPUnit for VSCode 3.0: VS Code Testing API and Docker
Testing PHP

PHPUnit for VSCode 3.0: VS Code Testing API and Docker

A complete rewrite of PHPUnit for VSCode using the VS Code Testing API for real-time sidebar results, now with Docker and SSH remote execution support.

2022 年 12 月 6 日
正體中文
PHPUnit Php VS Code Docker Testing
Featured image of post Laravel Queue Job Reads Stale Data in Transaction: Fix
Laravel PHP

Laravel Queue Job Reads Stale Data in Transaction: Fix

Jobs dispatched in a transaction re-query the DB via SerializesModels before commit, reading stale data. Use afterCommit() to delay dispatch until after commit.

2022 年 12 月 2 日
正體中文
Laravel Queue Redis
Featured image of post Laravel Testing: Assert View Data Without Parsing HTML
Laravel Testing

Laravel Testing: Assert View Data Without Parsing HTML

HTML assertions on complex views are brittle. Use viewData() to assert view variables directly, and compare Models by id or toArray() to avoid identity issues.

2022 年 11 月 29 日
正體中文
Laravel Testing Blade
1 3 4 5 6 7 8 9 10
© 2020 - 2026 recca0120 Tech Notes
recca0120 on GitHub
Built with Hugo
Theme Stack designed by Jimmy