WhenLoaded ()? ?????? ? ??? ??? ????? ?????. ??? ????? ? ?? ?? ??? ???????? ?? ?? N 1 ?? ?? ??? ????? ????. ?? ??, API ????? ??? ??? ? ?? ? ????, ?? ???? ?????? ???? ?? ()? ?? ??? ?? ??? ???. ??? ??? ? ?? ??? ???? () ?? ?? ???? ?? ?????? ??? ??????. ???? ??? ?? ? ??? ????? ?? ?? (?? ?? ???)? ?????.
Laravel??? ???? ??? ???? ?????????????? ??? ?? ????? ?? ??? ???? ? ?, whenLoaded()
??? ?????. ???? ??? ?? ??? ??? ??? ???????? ???? ??? ???? ?????.

??? ??? ? ??? ??? ?????? ??? ????.
whenLoaded()
??? ???????
whenLoaded()
???? ?? ??? ????????? ?????. ???? ?? ??? ????? ????? ??? ??? ? ????.

?? ??:
$ user-> WhenLoaded ( 'profile', function ($ profile) { // ??? ????? ? ???? ?????. $ profile-> is_complete? ?????? '??': '???'; });
????? $user->profile
???? ?? ? (??????? ?? ??? ??) N 1 ?? ?? ? ??? ??? ? ????.

?? whenLoaded()
????????
????? ??? ?? ?????? whenLoaded()
? ?????.
- API ?? ?? - ?? ????? ?? ?? ?? ? ?????.
- n 1 ??? ??? -?? ???? ???? ?? ?.
- ?? ??? ?? ???? ??? ?? - ?? ??? ???? ?? ??? ??????.
??? ???? ???? ??? ???? ??? ?? ? ???. ?????? ? ???? ??? ????????.
$ user-> WhenLoaded ( 'post', function ($ posts) { return $ post-> flatmap-> comment-> count (); });
????? ??? ?? ?? ?? ???? ???? ????.
?? ???? whenLoaded()
???? ??
Laravel Resource Collection???? ???? ?? ??? ????.
?? ?? toArray ($ ??) { ?? [ 'id'=> $ this-> id, '??'=> $ this-> ??, '???'=> $ this-> ???, '??_post_title'=> $ this-> whenloaded ( 'posts', function ($ posts) { ?? ?? ?? ($ post-> first ())-> ??; }), ]; }
??? ? ?? ?? :
- ?????? ??
optional()
???? ? ?? ???? ??? ???? ??? ? ? ????. -
latest_post_title
??posts
????? ? ???? ?????.
whenLoaded()
???? ??? ?? ? ??? ?? ??? ?? ??? ?? ??? ??? ? ? ????.
? ?? gotchas? ?
- ?? ???
whenLoaded()
? ???? ????? ??????-??? ?? ??? ???? ??? ??? ??? ???????. -
whenLoaded()
???? ??????? ????.with()
???? ? ???? ?????. - Laravel? ??? ?? (
when()
?mergeWhen()
)? ?? ? ?????.
? ?? ???? ?? :
-
whenLoaded()
????? ???? ??? ????? ? ??? ?????. - ??? ?? ??? ?? ???? ?? ?? ??? (?, ?? ??? ?? ?? ?? ??).
??? hasOne
?? belongsTo
? ?? ???? ?? ?? ?? ?? null
? ?? ? ????. hasMany
???? ???? ?? ? ????.
whenLoaded()
???? ???? ?? API ?? ??? ??? ??? ?? ? ? ??? ? ???? ????? ?? ? ????. Laravel? ?? ?? ? ???? ????? ?? ??? ??? ? ? ??? ????.
????? ?? ??.
? ??? laravel??`whenloaded ()`? ???? ??? ??? ?????.? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? PHP ??? ??? ??? ?? ???? ??? ?? ????? ???????. Laravel? ?? ??? ???? ??? ? ? ???? ??? ??? ???? ?????? ?? ? ?? ?? ???? ?????. Symfony? ? ???? ??? ???? ?????. Codeigniter? ??? ??? ?? ??? ?? ??? ?? ????? ?????. 2. AI ??? ???? ????? ??? ??? ??, ???? ?? ?? (? : ???, ??, F1 ?), ??? ? ?? ?? ? ?? ??? ?? ???? ?? ??? ???? ???? ?? ??? ? ?? ???? ?? ?? ??? ????? ?? ???? ????? ?????? ??? ????? ???????. 3. ??? ?? ?? ????? ?? ??? ?????. AES? ?? ??? ???? ????? ?????.

PHP?? ?? ??? ???? ? ?? ?? ??? ????. 1. php.ini? ?? ??? ??; 2. ? ?? (? : Apache? Setenv ?? nginx? FastCGI_Param)? ??????. 3. PHP ?????? putenv () ??? ??????. ? ??? Php.ini? ????? ??? ???? ??? ???? ? ?? ??? ?? ???? ????? ???? Putenv ()? ?? ??? ?????. ?? ???? ?? ?? (? : php.ini ?? ? ?? ??)? ???? ????. ?? ?? ??? ??? ?? ??? ????? ???? ?? ????.

PHP ????? ?? ??? ??? ? ??? ??? CI (Continuous Integration) ????? ???? ? ????. 1. DockerFile? ???? ?? ???, ?? ??, ??? ?? ? ?? ??? ???? PHP ??? ?????. 2. Gitlabci? ?? CI/CD ??? ???? .gitlab-ci.yml ??? ?? ??, ??? ? ?? ??? ???? ?? ??, ??? ? ??? ?????. 3. PHPUNIT? ?? ??? ??? ??? ???? ?? ?? ? ???? ???? ????????. 4. Kubernetes? ?? ?? ?? ??? ???? ?? .yaml ??? ?? ?? ??? ?????. 5. Dockerfile ??? ? ??? ??? ??????

PHP ??? ?? ???? ????? ??? ??, ??? ??, ?? ? ?? ?? ???? ???????. ??, ??? ?? ???? ???? JWT? ???? ??? ??? ??????. ??, ??? ?? ????? ? ?????? ??? ???? ?? ???? ?????. ??, Alipay ?? WeChat ??? ???? ???? ??? ?????. ??, ?? ?? ??? ?? ??? ??? ??? ?????. Laravel ??? ??? ???? ?? ???? ?????, ?? ?? ? ??? ??? ???? ??? ??? ????, ??? ????? ??, ??????, ?? ? ?? ??? ?????? ??? ??? ??????? ??? ? ??? ???????.

Laravel? eloquentscopes? ?? ??? ??? ??? ?????? ?? ?? ??? ????? ?????. 1. ?? ??? ???? ???? ???? ???? Post :: published (); 2. ??? ??? ?? ??? ???? ???? ?? ??? ?? ?? ?? ??? ???? ???? ??? ?????? ??? ???? ???????. 3. ????? ?? ?? ?? ??? ??? ?? ?? ??? ?? ? ? ??? ?? ? ? ?? ?? ??? ?????. 4. ?? ??? ? ??? ?? ???? ? ??? ? ?? ??, ?? ??, ?? ???? ? ?? ?????????.

??? ??? ??? ?? AI? ??? PHP? ?? ????? PHP? ??? "???"?????, ?? ???? ????? ???? ??? ? ??, ASYNCHRONOUS ??? ?? AI ??? (? : Google CloudVideoAi ?)? ??????? ????. 2. PHP? JSON ??? ?? ????, ??, ??, ??, ?? ? ?? ??? ???? ??? ??? ???? ??????? ?????. 3. ??? PHP? ??? ? ???? ???? ?? PHP ?????? ????? ????? ???? ? ??? AI ??? ???? ???? ????. 4. ???? ???? ??? ?? ?? (?? ?? ? URL??? ???? ????? ?? ??), ??? ?? (??? ??? ??), ?? ?? (??? ??, ?? ????) ? ?? ??? (?? ???)? ?????. 5. ??? ??? ????? ?? ?????

??, ???? ??? ??? ???? ???????. 1. ??? ??? ???? ?? ??? ???? ????. ????? HTTP ?? ? ?? ? ?????. 2. ?? ? ??? ?? Formrequests? ???? ?????? ?? ? ?? ??? ??????. 3. UserController? UserAccountController, UserPreferencesController ? UserseCurityController? ???? ?? ??? ?? ?? ????? ??????. 4. ????? ?? ??? ???? ??? ??? ??? ????? ??? ???? ??? ?????. 5. APIRESORCES ?? ViewCOPIPOS? ???? ???? ?????

??? ?? ??? PHP ???? ?? ?? ??? ???? ?? ???????. RBAC (Role-Based Access Control) ??? ?? ???, ?? ? ??? ???? ??? ?? ?? ? ??? ?????. ?? ???? ??? ?????. 1. ???, ?? ? ??? ? ???? user_roles ? role_permissions? 3 ?? ?? ???; 2. $ user-> can ( 'edit_post')? ?? ???? ?? ?? ??? ?????. 3. ??? ???? ??? ??????. 4. ?? ??? ???? ?? ?? ?? ? ??? ? ???? ???? ?? ??? ? ?? ??? ?????. 5. ??? ??? ?? ?? ???? ?? ???? "??"? ??????.
