[{"data":1,"prerenderedAt":11182},["ShallowReactive",2],{"article-coding":3,"content-navigation-8C37fagqQL":11112},[4,827,2362,2624,3100,4688,5327,5456,5659,6652,6734,6950,7245,7281,7521,8877,9041,9932,10546],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"category":6,"createdAt":11,"updatedAt":12,"body":13,"_type":821,"_id":822,"_source":823,"_file":824,"_stem":825,"_extension":826},"/article/coding/simple-debug-in-laravel","coding",false,"","在 Laravel 中簡單快速的 debug 方法","簡單記錄一下之前 debug 的方式。","2024-05-14","2025-12-22",{"type":14,"children":15,"toc":815},"root",[16,23,29,47,52,230,236,348,354,359,809],{"type":17,"tag":18,"props":19,"children":20},"element","p",{},[21],{"type":22,"value":10},"text",{"type":17,"tag":24,"props":25,"children":27},"h2",{"id":26},"在程式中排查",[28],{"type":22,"value":26},{"type":17,"tag":18,"props":30,"children":31},{},[32,39,41],{"type":17,"tag":33,"props":34,"children":36},"code",{"className":35},[],[37],{"type":22,"value":38},"dd()",{"type":22,"value":40},"、",{"type":17,"tag":33,"props":42,"children":44},{"className":43},[],[45],{"type":22,"value":46},"dump()",{"type":17,"tag":24,"props":48,"children":50},{"id":49},"程式執行過慢",[51],{"type":22,"value":49},{"type":17,"tag":53,"props":54,"children":58},"pre",{"className":55,"code":56,"language":57,"meta":8,"style":8},"language-php shiki shiki-themes material-theme-palenight","$start = microtime(true);\n// your code...\n$end = microtime(true);\n$execution = $end - $start;\nLog::info(\"Execution time: $execution\");\n","php",[59],{"type":17,"tag":33,"props":60,"children":61},{"__ignoreMap":8},[62,96,106,131,176],{"type":17,"tag":63,"props":64,"children":67},"span",{"class":65,"line":66},"line",1,[68,74,80,85,91],{"type":17,"tag":63,"props":69,"children":71},{"style":70},"--shiki-default:#89DDFF",[72],{"type":22,"value":73},"$",{"type":17,"tag":63,"props":75,"children":77},{"style":76},"--shiki-default:#BABED8",[78],{"type":22,"value":79},"start ",{"type":17,"tag":63,"props":81,"children":82},{"style":70},[83],{"type":22,"value":84},"=",{"type":17,"tag":63,"props":86,"children":88},{"style":87},"--shiki-default:#82AAFF",[89],{"type":22,"value":90}," microtime",{"type":17,"tag":63,"props":92,"children":93},{"style":70},[94],{"type":22,"value":95},"(true);\n",{"type":17,"tag":63,"props":97,"children":99},{"class":65,"line":98},2,[100],{"type":17,"tag":63,"props":101,"children":103},{"style":102},"--shiki-default:#676E95;--shiki-default-font-style:italic",[104],{"type":22,"value":105},"// your code...\n",{"type":17,"tag":63,"props":107,"children":109},{"class":65,"line":108},3,[110,114,119,123,127],{"type":17,"tag":63,"props":111,"children":112},{"style":70},[113],{"type":22,"value":73},{"type":17,"tag":63,"props":115,"children":116},{"style":76},[117],{"type":22,"value":118},"end ",{"type":17,"tag":63,"props":120,"children":121},{"style":70},[122],{"type":22,"value":84},{"type":17,"tag":63,"props":124,"children":125},{"style":87},[126],{"type":22,"value":90},{"type":17,"tag":63,"props":128,"children":129},{"style":70},[130],{"type":22,"value":95},{"type":17,"tag":63,"props":132,"children":134},{"class":65,"line":133},4,[135,139,144,148,153,157,162,166,171],{"type":17,"tag":63,"props":136,"children":137},{"style":70},[138],{"type":22,"value":73},{"type":17,"tag":63,"props":140,"children":141},{"style":76},[142],{"type":22,"value":143},"execution ",{"type":17,"tag":63,"props":145,"children":146},{"style":70},[147],{"type":22,"value":84},{"type":17,"tag":63,"props":149,"children":150},{"style":70},[151],{"type":22,"value":152}," $",{"type":17,"tag":63,"props":154,"children":155},{"style":76},[156],{"type":22,"value":118},{"type":17,"tag":63,"props":158,"children":159},{"style":70},[160],{"type":22,"value":161},"-",{"type":17,"tag":63,"props":163,"children":164},{"style":70},[165],{"type":22,"value":152},{"type":17,"tag":63,"props":167,"children":168},{"style":76},[169],{"type":22,"value":170},"start",{"type":17,"tag":63,"props":172,"children":173},{"style":70},[174],{"type":22,"value":175},";\n",{"type":17,"tag":63,"props":177,"children":179},{"class":65,"line":178},5,[180,186,191,196,201,206,212,216,221,225],{"type":17,"tag":63,"props":181,"children":183},{"style":182},"--shiki-default:#FFCB6B",[184],{"type":22,"value":185},"Log",{"type":17,"tag":63,"props":187,"children":188},{"style":70},[189],{"type":22,"value":190},"::",{"type":17,"tag":63,"props":192,"children":193},{"style":87},[194],{"type":22,"value":195},"info",{"type":17,"tag":63,"props":197,"children":198},{"style":70},[199],{"type":22,"value":200},"(",{"type":17,"tag":63,"props":202,"children":203},{"style":70},[204],{"type":22,"value":205},"\"",{"type":17,"tag":63,"props":207,"children":209},{"style":208},"--shiki-default:#C3E88D",[210],{"type":22,"value":211},"Execution time: ",{"type":17,"tag":63,"props":213,"children":214},{"style":70},[215],{"type":22,"value":73},{"type":17,"tag":63,"props":217,"children":218},{"style":76},[219],{"type":22,"value":220},"execution",{"type":17,"tag":63,"props":222,"children":223},{"style":70},[224],{"type":22,"value":205},{"type":17,"tag":63,"props":226,"children":227},{"style":70},[228],{"type":22,"value":229},");\n",{"type":17,"tag":24,"props":231,"children":233},{"id":232},"印出-query",[234],{"type":22,"value":235},"印出 Query",{"type":17,"tag":53,"props":237,"children":239},{"className":55,"code":238,"language":57,"meta":8,"style":8},"\\DB::connection()->enableQueryLog();\n// your code...\n$queries = \\DB::getQueryLog();\ndd($queries)\n",[240],{"type":17,"tag":33,"props":241,"children":242},{"__ignoreMap":8},[243,280,287,325],{"type":17,"tag":63,"props":244,"children":245},{"class":65,"line":66},[246,251,256,260,265,270,275],{"type":17,"tag":63,"props":247,"children":248},{"style":70},[249],{"type":22,"value":250},"\\",{"type":17,"tag":63,"props":252,"children":253},{"style":182},[254],{"type":22,"value":255},"DB",{"type":17,"tag":63,"props":257,"children":258},{"style":70},[259],{"type":22,"value":190},{"type":17,"tag":63,"props":261,"children":262},{"style":87},[263],{"type":22,"value":264},"connection",{"type":17,"tag":63,"props":266,"children":267},{"style":70},[268],{"type":22,"value":269},"()->",{"type":17,"tag":63,"props":271,"children":272},{"style":87},[273],{"type":22,"value":274},"enableQueryLog",{"type":17,"tag":63,"props":276,"children":277},{"style":70},[278],{"type":22,"value":279},"();\n",{"type":17,"tag":63,"props":281,"children":282},{"class":65,"line":98},[283],{"type":17,"tag":63,"props":284,"children":285},{"style":102},[286],{"type":22,"value":105},{"type":17,"tag":63,"props":288,"children":289},{"class":65,"line":108},[290,294,299,303,308,312,316,321],{"type":17,"tag":63,"props":291,"children":292},{"style":70},[293],{"type":22,"value":73},{"type":17,"tag":63,"props":295,"children":296},{"style":76},[297],{"type":22,"value":298},"queries ",{"type":17,"tag":63,"props":300,"children":301},{"style":70},[302],{"type":22,"value":84},{"type":17,"tag":63,"props":304,"children":305},{"style":70},[306],{"type":22,"value":307}," \\",{"type":17,"tag":63,"props":309,"children":310},{"style":182},[311],{"type":22,"value":255},{"type":17,"tag":63,"props":313,"children":314},{"style":70},[315],{"type":22,"value":190},{"type":17,"tag":63,"props":317,"children":318},{"style":87},[319],{"type":22,"value":320},"getQueryLog",{"type":17,"tag":63,"props":322,"children":323},{"style":70},[324],{"type":22,"value":279},{"type":17,"tag":63,"props":326,"children":327},{"class":65,"line":133},[328,333,338,343],{"type":17,"tag":63,"props":329,"children":330},{"style":87},[331],{"type":22,"value":332},"dd",{"type":17,"tag":63,"props":334,"children":335},{"style":70},[336],{"type":22,"value":337},"($",{"type":17,"tag":63,"props":339,"children":340},{"style":76},[341],{"type":22,"value":342},"queries",{"type":17,"tag":63,"props":344,"children":345},{"style":70},[346],{"type":22,"value":347},")\n",{"type":17,"tag":24,"props":349,"children":351},{"id":350},"觀察本次-request-消耗的資源",[352],{"type":22,"value":353},"觀察本次 Request 消耗的資源",{"type":17,"tag":18,"props":355,"children":356},{},[357],{"type":22,"value":358},"分別印出記憶體使用量、記憶體使用峰值、CPU 使用時間(s)",{"type":17,"tag":53,"props":360,"children":362},{"className":55,"code":361,"language":57,"meta":8,"style":8},"$startMemory = memory_get_usage();\n$cpuStart = getrusage();\n// your code...\n$endMemory = memory_get_usage();\n$peakMemory = memory_get_peak_usage();\n$cpuEnd = getrusage();\ndd(\"Memory: \" . (($endMemory - $startMemory) / 1024 / 1024) .\n    \"MB。 Peak Memory: \" . ($peakMemory / 1024 / 1024) . \"MB。 CPU: \" . (($cpuEnd['ru_utime.tv_sec'] - $cpuStart['ru_utime.tv_sec']) +\n        ($cpuEnd['ru_utime.tv_usec'] - $cpuStart['ru_utime.tv_usec']) / 1000000));\n",[363],{"type":17,"tag":33,"props":364,"children":365},{"__ignoreMap":8},[366,391,416,423,447,472,497,582,729],{"type":17,"tag":63,"props":367,"children":368},{"class":65,"line":66},[369,373,378,382,387],{"type":17,"tag":63,"props":370,"children":371},{"style":70},[372],{"type":22,"value":73},{"type":17,"tag":63,"props":374,"children":375},{"style":76},[376],{"type":22,"value":377},"startMemory ",{"type":17,"tag":63,"props":379,"children":380},{"style":70},[381],{"type":22,"value":84},{"type":17,"tag":63,"props":383,"children":384},{"style":87},[385],{"type":22,"value":386}," memory_get_usage",{"type":17,"tag":63,"props":388,"children":389},{"style":70},[390],{"type":22,"value":279},{"type":17,"tag":63,"props":392,"children":393},{"class":65,"line":98},[394,398,403,407,412],{"type":17,"tag":63,"props":395,"children":396},{"style":70},[397],{"type":22,"value":73},{"type":17,"tag":63,"props":399,"children":400},{"style":76},[401],{"type":22,"value":402},"cpuStart ",{"type":17,"tag":63,"props":404,"children":405},{"style":70},[406],{"type":22,"value":84},{"type":17,"tag":63,"props":408,"children":409},{"style":87},[410],{"type":22,"value":411}," getrusage",{"type":17,"tag":63,"props":413,"children":414},{"style":70},[415],{"type":22,"value":279},{"type":17,"tag":63,"props":417,"children":418},{"class":65,"line":108},[419],{"type":17,"tag":63,"props":420,"children":421},{"style":102},[422],{"type":22,"value":105},{"type":17,"tag":63,"props":424,"children":425},{"class":65,"line":133},[426,430,435,439,443],{"type":17,"tag":63,"props":427,"children":428},{"style":70},[429],{"type":22,"value":73},{"type":17,"tag":63,"props":431,"children":432},{"style":76},[433],{"type":22,"value":434},"endMemory ",{"type":17,"tag":63,"props":436,"children":437},{"style":70},[438],{"type":22,"value":84},{"type":17,"tag":63,"props":440,"children":441},{"style":87},[442],{"type":22,"value":386},{"type":17,"tag":63,"props":444,"children":445},{"style":70},[446],{"type":22,"value":279},{"type":17,"tag":63,"props":448,"children":449},{"class":65,"line":178},[450,454,459,463,468],{"type":17,"tag":63,"props":451,"children":452},{"style":70},[453],{"type":22,"value":73},{"type":17,"tag":63,"props":455,"children":456},{"style":76},[457],{"type":22,"value":458},"peakMemory ",{"type":17,"tag":63,"props":460,"children":461},{"style":70},[462],{"type":22,"value":84},{"type":17,"tag":63,"props":464,"children":465},{"style":87},[466],{"type":22,"value":467}," memory_get_peak_usage",{"type":17,"tag":63,"props":469,"children":470},{"style":70},[471],{"type":22,"value":279},{"type":17,"tag":63,"props":473,"children":475},{"class":65,"line":474},6,[476,480,485,489,493],{"type":17,"tag":63,"props":477,"children":478},{"style":70},[479],{"type":22,"value":73},{"type":17,"tag":63,"props":481,"children":482},{"style":76},[483],{"type":22,"value":484},"cpuEnd ",{"type":17,"tag":63,"props":486,"children":487},{"style":70},[488],{"type":22,"value":84},{"type":17,"tag":63,"props":490,"children":491},{"style":87},[492],{"type":22,"value":411},{"type":17,"tag":63,"props":494,"children":495},{"style":70},[496],{"type":22,"value":279},{"type":17,"tag":63,"props":498,"children":500},{"class":65,"line":499},7,[501,505,509,513,518,522,527,532,536,540,544,549,554,559,565,569,573,577],{"type":17,"tag":63,"props":502,"children":503},{"style":87},[504],{"type":22,"value":332},{"type":17,"tag":63,"props":506,"children":507},{"style":70},[508],{"type":22,"value":200},{"type":17,"tag":63,"props":510,"children":511},{"style":70},[512],{"type":22,"value":205},{"type":17,"tag":63,"props":514,"children":515},{"style":208},[516],{"type":22,"value":517},"Memory: ",{"type":17,"tag":63,"props":519,"children":520},{"style":70},[521],{"type":22,"value":205},{"type":17,"tag":63,"props":523,"children":524},{"style":70},[525],{"type":22,"value":526}," .",{"type":17,"tag":63,"props":528,"children":529},{"style":70},[530],{"type":22,"value":531}," (($",{"type":17,"tag":63,"props":533,"children":534},{"style":76},[535],{"type":22,"value":434},{"type":17,"tag":63,"props":537,"children":538},{"style":70},[539],{"type":22,"value":161},{"type":17,"tag":63,"props":541,"children":542},{"style":70},[543],{"type":22,"value":152},{"type":17,"tag":63,"props":545,"children":546},{"style":76},[547],{"type":22,"value":548},"startMemory",{"type":17,"tag":63,"props":550,"children":551},{"style":70},[552],{"type":22,"value":553},")",{"type":17,"tag":63,"props":555,"children":556},{"style":70},[557],{"type":22,"value":558}," /",{"type":17,"tag":63,"props":560,"children":562},{"style":561},"--shiki-default:#F78C6C",[563],{"type":22,"value":564}," 1024",{"type":17,"tag":63,"props":566,"children":567},{"style":70},[568],{"type":22,"value":558},{"type":17,"tag":63,"props":570,"children":571},{"style":561},[572],{"type":22,"value":564},{"type":17,"tag":63,"props":574,"children":575},{"style":70},[576],{"type":22,"value":553},{"type":17,"tag":63,"props":578,"children":579},{"style":70},[580],{"type":22,"value":581}," .\n",{"type":17,"tag":63,"props":583,"children":585},{"class":65,"line":584},8,[586,591,596,600,604,609,613,618,622,626,630,634,638,643,648,652,656,660,665,670,675,680,684,689,694,698,703,707,711,715,719,724],{"type":17,"tag":63,"props":587,"children":588},{"style":70},[589],{"type":22,"value":590},"    \"",{"type":17,"tag":63,"props":592,"children":593},{"style":208},[594],{"type":22,"value":595},"MB。 Peak Memory: ",{"type":17,"tag":63,"props":597,"children":598},{"style":70},[599],{"type":22,"value":205},{"type":17,"tag":63,"props":601,"children":602},{"style":70},[603],{"type":22,"value":526},{"type":17,"tag":63,"props":605,"children":606},{"style":70},[607],{"type":22,"value":608}," ($",{"type":17,"tag":63,"props":610,"children":611},{"style":76},[612],{"type":22,"value":458},{"type":17,"tag":63,"props":614,"children":615},{"style":70},[616],{"type":22,"value":617},"/",{"type":17,"tag":63,"props":619,"children":620},{"style":561},[621],{"type":22,"value":564},{"type":17,"tag":63,"props":623,"children":624},{"style":70},[625],{"type":22,"value":558},{"type":17,"tag":63,"props":627,"children":628},{"style":561},[629],{"type":22,"value":564},{"type":17,"tag":63,"props":631,"children":632},{"style":70},[633],{"type":22,"value":553},{"type":17,"tag":63,"props":635,"children":636},{"style":70},[637],{"type":22,"value":526},{"type":17,"tag":63,"props":639,"children":640},{"style":70},[641],{"type":22,"value":642}," \"",{"type":17,"tag":63,"props":644,"children":645},{"style":208},[646],{"type":22,"value":647},"MB。 CPU: ",{"type":17,"tag":63,"props":649,"children":650},{"style":70},[651],{"type":22,"value":205},{"type":17,"tag":63,"props":653,"children":654},{"style":70},[655],{"type":22,"value":526},{"type":17,"tag":63,"props":657,"children":658},{"style":70},[659],{"type":22,"value":531},{"type":17,"tag":63,"props":661,"children":662},{"style":76},[663],{"type":22,"value":664},"cpuEnd",{"type":17,"tag":63,"props":666,"children":667},{"style":70},[668],{"type":22,"value":669},"[",{"type":17,"tag":63,"props":671,"children":672},{"style":70},[673],{"type":22,"value":674},"'",{"type":17,"tag":63,"props":676,"children":677},{"style":208},[678],{"type":22,"value":679},"ru_utime.tv_sec",{"type":17,"tag":63,"props":681,"children":682},{"style":70},[683],{"type":22,"value":674},{"type":17,"tag":63,"props":685,"children":686},{"style":70},[687],{"type":22,"value":688},"]",{"type":17,"tag":63,"props":690,"children":691},{"style":70},[692],{"type":22,"value":693}," -",{"type":17,"tag":63,"props":695,"children":696},{"style":70},[697],{"type":22,"value":152},{"type":17,"tag":63,"props":699,"children":700},{"style":76},[701],{"type":22,"value":702},"cpuStart",{"type":17,"tag":63,"props":704,"children":705},{"style":70},[706],{"type":22,"value":669},{"type":17,"tag":63,"props":708,"children":709},{"style":70},[710],{"type":22,"value":674},{"type":17,"tag":63,"props":712,"children":713},{"style":208},[714],{"type":22,"value":679},{"type":17,"tag":63,"props":716,"children":717},{"style":70},[718],{"type":22,"value":674},{"type":17,"tag":63,"props":720,"children":721},{"style":70},[722],{"type":22,"value":723},"])",{"type":17,"tag":63,"props":725,"children":726},{"style":70},[727],{"type":22,"value":728}," +\n",{"type":17,"tag":63,"props":730,"children":732},{"class":65,"line":731},9,[733,738,742,746,750,755,759,763,767,771,775,779,783,787,791,795,799,804],{"type":17,"tag":63,"props":734,"children":735},{"style":70},[736],{"type":22,"value":737},"        ($",{"type":17,"tag":63,"props":739,"children":740},{"style":76},[741],{"type":22,"value":664},{"type":17,"tag":63,"props":743,"children":744},{"style":70},[745],{"type":22,"value":669},{"type":17,"tag":63,"props":747,"children":748},{"style":70},[749],{"type":22,"value":674},{"type":17,"tag":63,"props":751,"children":752},{"style":208},[753],{"type":22,"value":754},"ru_utime.tv_usec",{"type":17,"tag":63,"props":756,"children":757},{"style":70},[758],{"type":22,"value":674},{"type":17,"tag":63,"props":760,"children":761},{"style":70},[762],{"type":22,"value":688},{"type":17,"tag":63,"props":764,"children":765},{"style":70},[766],{"type":22,"value":693},{"type":17,"tag":63,"props":768,"children":769},{"style":70},[770],{"type":22,"value":152},{"type":17,"tag":63,"props":772,"children":773},{"style":76},[774],{"type":22,"value":702},{"type":17,"tag":63,"props":776,"children":777},{"style":70},[778],{"type":22,"value":669},{"type":17,"tag":63,"props":780,"children":781},{"style":70},[782],{"type":22,"value":674},{"type":17,"tag":63,"props":784,"children":785},{"style":208},[786],{"type":22,"value":754},{"type":17,"tag":63,"props":788,"children":789},{"style":70},[790],{"type":22,"value":674},{"type":17,"tag":63,"props":792,"children":793},{"style":70},[794],{"type":22,"value":723},{"type":17,"tag":63,"props":796,"children":797},{"style":70},[798],{"type":22,"value":558},{"type":17,"tag":63,"props":800,"children":801},{"style":561},[802],{"type":22,"value":803}," 1000000",{"type":17,"tag":63,"props":805,"children":806},{"style":70},[807],{"type":22,"value":808},"));\n",{"type":17,"tag":810,"props":811,"children":812},"style",{},[813],{"type":22,"value":814},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":8,"searchDepth":98,"depth":98,"links":816},[817,818,819,820],{"id":26,"depth":98,"text":26},{"id":49,"depth":98,"text":49},{"id":232,"depth":98,"text":235},{"id":350,"depth":98,"text":353},"markdown","content:article:coding:simple-debug-in-laravel.md","content","article/coding/simple-debug-in-laravel.md","article/coding/simple-debug-in-laravel","md",{"_path":828,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":829,"description":830,"category":6,"createdAt":831,"updatedAt":831,"body":832,"_type":821,"_id":2359,"_source":823,"_file":2360,"_stem":2361,"_extension":826},"/article/coding/calculate-total-unique-date-range-in-php","在 PHP 中計算不重複的日期區間加總","有一組不固定長度的 array，裡面包含了工作經歷的起訖日期，例如:","2024-11-03",{"type":14,"children":833,"toc":2356},[834,838,1341,1346,1351,2352],{"type":17,"tag":18,"props":835,"children":836},{},[837],{"type":22,"value":830},{"type":17,"tag":53,"props":839,"children":841},{"className":55,"code":840,"language":57,"meta":8,"style":8},"$workExps = [\n    ['startDate' => '2020/01', 'endDate' => '2023/02'], ['startDate' => '2024/06', 'endDate' => '2024/07'],\n];\n// or\n$workExps = [\n    ['startDate' => '2020/01', 'endDate' => '2022/08'], ['startDate' => '2021/05', 'endDate' => '2023/05'],\n    ['startDate' => '2020/01', 'endDate' => '2022/08'], ['startDate' => '2021/05', 'endDate' => '2023/05'],\n];\n",[842],{"type":17,"tag":33,"props":843,"children":844},{"__ignoreMap":8},[845,866,1018,1026,1034,1053,1195,1334],{"type":17,"tag":63,"props":846,"children":847},{"class":65,"line":66},[848,852,857,861],{"type":17,"tag":63,"props":849,"children":850},{"style":70},[851],{"type":22,"value":73},{"type":17,"tag":63,"props":853,"children":854},{"style":76},[855],{"type":22,"value":856},"workExps ",{"type":17,"tag":63,"props":858,"children":859},{"style":70},[860],{"type":22,"value":84},{"type":17,"tag":63,"props":862,"children":863},{"style":70},[864],{"type":22,"value":865}," [\n",{"type":17,"tag":63,"props":867,"children":868},{"class":65,"line":98},[869,874,878,883,887,892,897,902,906,911,915,920,924,928,932,937,941,946,951,955,959,963,967,971,976,980,984,988,992,996,1000,1004,1009,1013],{"type":17,"tag":63,"props":870,"children":871},{"style":70},[872],{"type":22,"value":873},"    [",{"type":17,"tag":63,"props":875,"children":876},{"style":70},[877],{"type":22,"value":674},{"type":17,"tag":63,"props":879,"children":880},{"style":208},[881],{"type":22,"value":882},"startDate",{"type":17,"tag":63,"props":884,"children":885},{"style":70},[886],{"type":22,"value":674},{"type":17,"tag":63,"props":888,"children":889},{"style":70},[890],{"type":22,"value":891}," =>",{"type":17,"tag":63,"props":893,"children":894},{"style":70},[895],{"type":22,"value":896}," '",{"type":17,"tag":63,"props":898,"children":899},{"style":208},[900],{"type":22,"value":901},"2020/01",{"type":17,"tag":63,"props":903,"children":904},{"style":70},[905],{"type":22,"value":674},{"type":17,"tag":63,"props":907,"children":908},{"style":70},[909],{"type":22,"value":910},",",{"type":17,"tag":63,"props":912,"children":913},{"style":70},[914],{"type":22,"value":896},{"type":17,"tag":63,"props":916,"children":917},{"style":208},[918],{"type":22,"value":919},"endDate",{"type":17,"tag":63,"props":921,"children":922},{"style":70},[923],{"type":22,"value":674},{"type":17,"tag":63,"props":925,"children":926},{"style":70},[927],{"type":22,"value":891},{"type":17,"tag":63,"props":929,"children":930},{"style":70},[931],{"type":22,"value":896},{"type":17,"tag":63,"props":933,"children":934},{"style":208},[935],{"type":22,"value":936},"2023/02",{"type":17,"tag":63,"props":938,"children":939},{"style":70},[940],{"type":22,"value":674},{"type":17,"tag":63,"props":942,"children":943},{"style":70},[944],{"type":22,"value":945},"],",{"type":17,"tag":63,"props":947,"children":948},{"style":70},[949],{"type":22,"value":950}," [",{"type":17,"tag":63,"props":952,"children":953},{"style":70},[954],{"type":22,"value":674},{"type":17,"tag":63,"props":956,"children":957},{"style":208},[958],{"type":22,"value":882},{"type":17,"tag":63,"props":960,"children":961},{"style":70},[962],{"type":22,"value":674},{"type":17,"tag":63,"props":964,"children":965},{"style":70},[966],{"type":22,"value":891},{"type":17,"tag":63,"props":968,"children":969},{"style":70},[970],{"type":22,"value":896},{"type":17,"tag":63,"props":972,"children":973},{"style":208},[974],{"type":22,"value":975},"2024/06",{"type":17,"tag":63,"props":977,"children":978},{"style":70},[979],{"type":22,"value":674},{"type":17,"tag":63,"props":981,"children":982},{"style":70},[983],{"type":22,"value":910},{"type":17,"tag":63,"props":985,"children":986},{"style":70},[987],{"type":22,"value":896},{"type":17,"tag":63,"props":989,"children":990},{"style":208},[991],{"type":22,"value":919},{"type":17,"tag":63,"props":993,"children":994},{"style":70},[995],{"type":22,"value":674},{"type":17,"tag":63,"props":997,"children":998},{"style":70},[999],{"type":22,"value":891},{"type":17,"tag":63,"props":1001,"children":1002},{"style":70},[1003],{"type":22,"value":896},{"type":17,"tag":63,"props":1005,"children":1006},{"style":208},[1007],{"type":22,"value":1008},"2024/07",{"type":17,"tag":63,"props":1010,"children":1011},{"style":70},[1012],{"type":22,"value":674},{"type":17,"tag":63,"props":1014,"children":1015},{"style":70},[1016],{"type":22,"value":1017},"],\n",{"type":17,"tag":63,"props":1019,"children":1020},{"class":65,"line":108},[1021],{"type":17,"tag":63,"props":1022,"children":1023},{"style":70},[1024],{"type":22,"value":1025},"];\n",{"type":17,"tag":63,"props":1027,"children":1028},{"class":65,"line":133},[1029],{"type":17,"tag":63,"props":1030,"children":1031},{"style":102},[1032],{"type":22,"value":1033},"// or\n",{"type":17,"tag":63,"props":1035,"children":1036},{"class":65,"line":178},[1037,1041,1045,1049],{"type":17,"tag":63,"props":1038,"children":1039},{"style":70},[1040],{"type":22,"value":73},{"type":17,"tag":63,"props":1042,"children":1043},{"style":76},[1044],{"type":22,"value":856},{"type":17,"tag":63,"props":1046,"children":1047},{"style":70},[1048],{"type":22,"value":84},{"type":17,"tag":63,"props":1050,"children":1051},{"style":70},[1052],{"type":22,"value":865},{"type":17,"tag":63,"props":1054,"children":1055},{"class":65,"line":474},[1056,1060,1064,1068,1072,1076,1080,1084,1088,1092,1096,1100,1104,1108,1112,1117,1121,1125,1129,1133,1137,1141,1145,1149,1154,1158,1162,1166,1170,1174,1178,1182,1187,1191],{"type":17,"tag":63,"props":1057,"children":1058},{"style":70},[1059],{"type":22,"value":873},{"type":17,"tag":63,"props":1061,"children":1062},{"style":70},[1063],{"type":22,"value":674},{"type":17,"tag":63,"props":1065,"children":1066},{"style":208},[1067],{"type":22,"value":882},{"type":17,"tag":63,"props":1069,"children":1070},{"style":70},[1071],{"type":22,"value":674},{"type":17,"tag":63,"props":1073,"children":1074},{"style":70},[1075],{"type":22,"value":891},{"type":17,"tag":63,"props":1077,"children":1078},{"style":70},[1079],{"type":22,"value":896},{"type":17,"tag":63,"props":1081,"children":1082},{"style":208},[1083],{"type":22,"value":901},{"type":17,"tag":63,"props":1085,"children":1086},{"style":70},[1087],{"type":22,"value":674},{"type":17,"tag":63,"props":1089,"children":1090},{"style":70},[1091],{"type":22,"value":910},{"type":17,"tag":63,"props":1093,"children":1094},{"style":70},[1095],{"type":22,"value":896},{"type":17,"tag":63,"props":1097,"children":1098},{"style":208},[1099],{"type":22,"value":919},{"type":17,"tag":63,"props":1101,"children":1102},{"style":70},[1103],{"type":22,"value":674},{"type":17,"tag":63,"props":1105,"children":1106},{"style":70},[1107],{"type":22,"value":891},{"type":17,"tag":63,"props":1109,"children":1110},{"style":70},[1111],{"type":22,"value":896},{"type":17,"tag":63,"props":1113,"children":1114},{"style":208},[1115],{"type":22,"value":1116},"2022/08",{"type":17,"tag":63,"props":1118,"children":1119},{"style":70},[1120],{"type":22,"value":674},{"type":17,"tag":63,"props":1122,"children":1123},{"style":70},[1124],{"type":22,"value":945},{"type":17,"tag":63,"props":1126,"children":1127},{"style":70},[1128],{"type":22,"value":950},{"type":17,"tag":63,"props":1130,"children":1131},{"style":70},[1132],{"type":22,"value":674},{"type":17,"tag":63,"props":1134,"children":1135},{"style":208},[1136],{"type":22,"value":882},{"type":17,"tag":63,"props":1138,"children":1139},{"style":70},[1140],{"type":22,"value":674},{"type":17,"tag":63,"props":1142,"children":1143},{"style":70},[1144],{"type":22,"value":891},{"type":17,"tag":63,"props":1146,"children":1147},{"style":70},[1148],{"type":22,"value":896},{"type":17,"tag":63,"props":1150,"children":1151},{"style":208},[1152],{"type":22,"value":1153},"2021/05",{"type":17,"tag":63,"props":1155,"children":1156},{"style":70},[1157],{"type":22,"value":674},{"type":17,"tag":63,"props":1159,"children":1160},{"style":70},[1161],{"type":22,"value":910},{"type":17,"tag":63,"props":1163,"children":1164},{"style":70},[1165],{"type":22,"value":896},{"type":17,"tag":63,"props":1167,"children":1168},{"style":208},[1169],{"type":22,"value":919},{"type":17,"tag":63,"props":1171,"children":1172},{"style":70},[1173],{"type":22,"value":674},{"type":17,"tag":63,"props":1175,"children":1176},{"style":70},[1177],{"type":22,"value":891},{"type":17,"tag":63,"props":1179,"children":1180},{"style":70},[1181],{"type":22,"value":896},{"type":17,"tag":63,"props":1183,"children":1184},{"style":208},[1185],{"type":22,"value":1186},"2023/05",{"type":17,"tag":63,"props":1188,"children":1189},{"style":70},[1190],{"type":22,"value":674},{"type":17,"tag":63,"props":1192,"children":1193},{"style":70},[1194],{"type":22,"value":1017},{"type":17,"tag":63,"props":1196,"children":1197},{"class":65,"line":499},[1198,1202,1206,1210,1214,1218,1222,1226,1230,1234,1238,1242,1246,1250,1254,1258,1262,1266,1270,1274,1278,1282,1286,1290,1294,1298,1302,1306,1310,1314,1318,1322,1326,1330],{"type":17,"tag":63,"props":1199,"children":1200},{"style":70},[1201],{"type":22,"value":873},{"type":17,"tag":63,"props":1203,"children":1204},{"style":70},[1205],{"type":22,"value":674},{"type":17,"tag":63,"props":1207,"children":1208},{"style":208},[1209],{"type":22,"value":882},{"type":17,"tag":63,"props":1211,"children":1212},{"style":70},[1213],{"type":22,"value":674},{"type":17,"tag":63,"props":1215,"children":1216},{"style":70},[1217],{"type":22,"value":891},{"type":17,"tag":63,"props":1219,"children":1220},{"style":70},[1221],{"type":22,"value":896},{"type":17,"tag":63,"props":1223,"children":1224},{"style":208},[1225],{"type":22,"value":901},{"type":17,"tag":63,"props":1227,"children":1228},{"style":70},[1229],{"type":22,"value":674},{"type":17,"tag":63,"props":1231,"children":1232},{"style":70},[1233],{"type":22,"value":910},{"type":17,"tag":63,"props":1235,"children":1236},{"style":70},[1237],{"type":22,"value":896},{"type":17,"tag":63,"props":1239,"children":1240},{"style":208},[1241],{"type":22,"value":919},{"type":17,"tag":63,"props":1243,"children":1244},{"style":70},[1245],{"type":22,"value":674},{"type":17,"tag":63,"props":1247,"children":1248},{"style":70},[1249],{"type":22,"value":891},{"type":17,"tag":63,"props":1251,"children":1252},{"style":70},[1253],{"type":22,"value":896},{"type":17,"tag":63,"props":1255,"children":1256},{"style":208},[1257],{"type":22,"value":1116},{"type":17,"tag":63,"props":1259,"children":1260},{"style":70},[1261],{"type":22,"value":674},{"type":17,"tag":63,"props":1263,"children":1264},{"style":70},[1265],{"type":22,"value":945},{"type":17,"tag":63,"props":1267,"children":1268},{"style":70},[1269],{"type":22,"value":950},{"type":17,"tag":63,"props":1271,"children":1272},{"style":70},[1273],{"type":22,"value":674},{"type":17,"tag":63,"props":1275,"children":1276},{"style":208},[1277],{"type":22,"value":882},{"type":17,"tag":63,"props":1279,"children":1280},{"style":70},[1281],{"type":22,"value":674},{"type":17,"tag":63,"props":1283,"children":1284},{"style":70},[1285],{"type":22,"value":891},{"type":17,"tag":63,"props":1287,"children":1288},{"style":70},[1289],{"type":22,"value":896},{"type":17,"tag":63,"props":1291,"children":1292},{"style":208},[1293],{"type":22,"value":1153},{"type":17,"tag":63,"props":1295,"children":1296},{"style":70},[1297],{"type":22,"value":674},{"type":17,"tag":63,"props":1299,"children":1300},{"style":70},[1301],{"type":22,"value":910},{"type":17,"tag":63,"props":1303,"children":1304},{"style":70},[1305],{"type":22,"value":896},{"type":17,"tag":63,"props":1307,"children":1308},{"style":208},[1309],{"type":22,"value":919},{"type":17,"tag":63,"props":1311,"children":1312},{"style":70},[1313],{"type":22,"value":674},{"type":17,"tag":63,"props":1315,"children":1316},{"style":70},[1317],{"type":22,"value":891},{"type":17,"tag":63,"props":1319,"children":1320},{"style":70},[1321],{"type":22,"value":896},{"type":17,"tag":63,"props":1323,"children":1324},{"style":208},[1325],{"type":22,"value":1186},{"type":17,"tag":63,"props":1327,"children":1328},{"style":70},[1329],{"type":22,"value":674},{"type":17,"tag":63,"props":1331,"children":1332},{"style":70},[1333],{"type":22,"value":1017},{"type":17,"tag":63,"props":1335,"children":1336},{"class":65,"line":584},[1337],{"type":17,"tag":63,"props":1338,"children":1339},{"style":70},[1340],{"type":22,"value":1025},{"type":17,"tag":18,"props":1342,"children":1343},{},[1344],{"type":22,"value":1345},"需要去計算工作日期的區間總合，且不能計算重複的日期，回傳一個 array 包含計算後的年和月。",{"type":17,"tag":24,"props":1347,"children":1349},{"id":1348},"範例",[1350],{"type":22,"value":1348},{"type":17,"tag":53,"props":1352,"children":1354},{"className":55,"code":1353,"language":57,"meta":8,"style":8},"$totalMonths = 0;\n$periods = [];\n\nforeach ($workExps as $workExp) {\n    $start = Carbon::createFromFormat('Y/m', $workExp['startDate'])->startOfMonth();\n    $end = Carbon::createFromFormat('Y/m', $workExp['endDate'])->startOfMonth();\n    $newPeriod = CarbonPeriod::create($start, $end);\n    $overlap = false;\n    foreach ($periods as $index => $period) {\n        if ($newPeriod->overlaps($period)) {\n            $periods[$index] = CarbonPeriod::create(\n                min($period->getStartDate(), $newPeriod->getStartDate()),\n                max($period->getEndDate(), $newPeriod->getEndDate())\n            );\n            $overlap = true;\n            break;\n        }\n    }\n    if (!$overlap) {\n        $periods[] = $newPeriod;\n    }\n}\nforeach ($periods as $period) {\n    $start = $period->getStartDate();\n    $end = $period->getEndDate();\n    $totalMonths += $start->diffInMonths($end);\n}\n$resumeData['seniority'] = [(int) floor($totalMonths / 12), $totalMonths % 12];\n",[1355],{"type":17,"tag":33,"props":1356,"children":1357},{"__ignoreMap":8},[1358,1383,1404,1413,1453,1542,1625,1680,1701,1752,1797,1847,1899,1950,1959,1980,1993,2002,2011,2038,2072,2080,2089,2125,2161,2197,2243,2251],{"type":17,"tag":63,"props":1359,"children":1360},{"class":65,"line":66},[1361,1365,1370,1374,1379],{"type":17,"tag":63,"props":1362,"children":1363},{"style":70},[1364],{"type":22,"value":73},{"type":17,"tag":63,"props":1366,"children":1367},{"style":76},[1368],{"type":22,"value":1369},"totalMonths ",{"type":17,"tag":63,"props":1371,"children":1372},{"style":70},[1373],{"type":22,"value":84},{"type":17,"tag":63,"props":1375,"children":1376},{"style":561},[1377],{"type":22,"value":1378}," 0",{"type":17,"tag":63,"props":1380,"children":1381},{"style":70},[1382],{"type":22,"value":175},{"type":17,"tag":63,"props":1384,"children":1385},{"class":65,"line":98},[1386,1390,1395,1399],{"type":17,"tag":63,"props":1387,"children":1388},{"style":70},[1389],{"type":22,"value":73},{"type":17,"tag":63,"props":1391,"children":1392},{"style":76},[1393],{"type":22,"value":1394},"periods ",{"type":17,"tag":63,"props":1396,"children":1397},{"style":70},[1398],{"type":22,"value":84},{"type":17,"tag":63,"props":1400,"children":1401},{"style":70},[1402],{"type":22,"value":1403}," [];\n",{"type":17,"tag":63,"props":1405,"children":1406},{"class":65,"line":108},[1407],{"type":17,"tag":63,"props":1408,"children":1410},{"emptyLinePlaceholder":1409},true,[1411],{"type":22,"value":1412},"\n",{"type":17,"tag":63,"props":1414,"children":1415},{"class":65,"line":133},[1416,1422,1426,1430,1435,1439,1444,1448],{"type":17,"tag":63,"props":1417,"children":1419},{"style":1418},"--shiki-default:#89DDFF;--shiki-default-font-style:italic",[1420],{"type":22,"value":1421},"foreach",{"type":17,"tag":63,"props":1423,"children":1424},{"style":70},[1425],{"type":22,"value":608},{"type":17,"tag":63,"props":1427,"children":1428},{"style":76},[1429],{"type":22,"value":856},{"type":17,"tag":63,"props":1431,"children":1432},{"style":70},[1433],{"type":22,"value":1434},"as",{"type":17,"tag":63,"props":1436,"children":1437},{"style":70},[1438],{"type":22,"value":152},{"type":17,"tag":63,"props":1440,"children":1441},{"style":76},[1442],{"type":22,"value":1443},"workExp",{"type":17,"tag":63,"props":1445,"children":1446},{"style":70},[1447],{"type":22,"value":553},{"type":17,"tag":63,"props":1449,"children":1450},{"style":70},[1451],{"type":22,"value":1452}," {\n",{"type":17,"tag":63,"props":1454,"children":1455},{"class":65,"line":178},[1456,1461,1465,1469,1474,1478,1483,1487,1491,1496,1500,1504,1508,1512,1516,1520,1524,1528,1533,1538],{"type":17,"tag":63,"props":1457,"children":1458},{"style":70},[1459],{"type":22,"value":1460},"    $",{"type":17,"tag":63,"props":1462,"children":1463},{"style":76},[1464],{"type":22,"value":79},{"type":17,"tag":63,"props":1466,"children":1467},{"style":70},[1468],{"type":22,"value":84},{"type":17,"tag":63,"props":1470,"children":1471},{"style":182},[1472],{"type":22,"value":1473}," Carbon",{"type":17,"tag":63,"props":1475,"children":1476},{"style":70},[1477],{"type":22,"value":190},{"type":17,"tag":63,"props":1479,"children":1480},{"style":87},[1481],{"type":22,"value":1482},"createFromFormat",{"type":17,"tag":63,"props":1484,"children":1485},{"style":70},[1486],{"type":22,"value":200},{"type":17,"tag":63,"props":1488,"children":1489},{"style":70},[1490],{"type":22,"value":674},{"type":17,"tag":63,"props":1492,"children":1493},{"style":208},[1494],{"type":22,"value":1495},"Y/m",{"type":17,"tag":63,"props":1497,"children":1498},{"style":70},[1499],{"type":22,"value":674},{"type":17,"tag":63,"props":1501,"children":1502},{"style":70},[1503],{"type":22,"value":910},{"type":17,"tag":63,"props":1505,"children":1506},{"style":70},[1507],{"type":22,"value":152},{"type":17,"tag":63,"props":1509,"children":1510},{"style":76},[1511],{"type":22,"value":1443},{"type":17,"tag":63,"props":1513,"children":1514},{"style":70},[1515],{"type":22,"value":669},{"type":17,"tag":63,"props":1517,"children":1518},{"style":70},[1519],{"type":22,"value":674},{"type":17,"tag":63,"props":1521,"children":1522},{"style":208},[1523],{"type":22,"value":882},{"type":17,"tag":63,"props":1525,"children":1526},{"style":70},[1527],{"type":22,"value":674},{"type":17,"tag":63,"props":1529,"children":1530},{"style":70},[1531],{"type":22,"value":1532},"])->",{"type":17,"tag":63,"props":1534,"children":1535},{"style":87},[1536],{"type":22,"value":1537},"startOfMonth",{"type":17,"tag":63,"props":1539,"children":1540},{"style":70},[1541],{"type":22,"value":279},{"type":17,"tag":63,"props":1543,"children":1544},{"class":65,"line":474},[1545,1549,1553,1557,1561,1565,1569,1573,1577,1581,1585,1589,1593,1597,1601,1605,1609,1613,1617,1621],{"type":17,"tag":63,"props":1546,"children":1547},{"style":70},[1548],{"type":22,"value":1460},{"type":17,"tag":63,"props":1550,"children":1551},{"style":76},[1552],{"type":22,"value":118},{"type":17,"tag":63,"props":1554,"children":1555},{"style":70},[1556],{"type":22,"value":84},{"type":17,"tag":63,"props":1558,"children":1559},{"style":182},[1560],{"type":22,"value":1473},{"type":17,"tag":63,"props":1562,"children":1563},{"style":70},[1564],{"type":22,"value":190},{"type":17,"tag":63,"props":1566,"children":1567},{"style":87},[1568],{"type":22,"value":1482},{"type":17,"tag":63,"props":1570,"children":1571},{"style":70},[1572],{"type":22,"value":200},{"type":17,"tag":63,"props":1574,"children":1575},{"style":70},[1576],{"type":22,"value":674},{"type":17,"tag":63,"props":1578,"children":1579},{"style":208},[1580],{"type":22,"value":1495},{"type":17,"tag":63,"props":1582,"children":1583},{"style":70},[1584],{"type":22,"value":674},{"type":17,"tag":63,"props":1586,"children":1587},{"style":70},[1588],{"type":22,"value":910},{"type":17,"tag":63,"props":1590,"children":1591},{"style":70},[1592],{"type":22,"value":152},{"type":17,"tag":63,"props":1594,"children":1595},{"style":76},[1596],{"type":22,"value":1443},{"type":17,"tag":63,"props":1598,"children":1599},{"style":70},[1600],{"type":22,"value":669},{"type":17,"tag":63,"props":1602,"children":1603},{"style":70},[1604],{"type":22,"value":674},{"type":17,"tag":63,"props":1606,"children":1607},{"style":208},[1608],{"type":22,"value":919},{"type":17,"tag":63,"props":1610,"children":1611},{"style":70},[1612],{"type":22,"value":674},{"type":17,"tag":63,"props":1614,"children":1615},{"style":70},[1616],{"type":22,"value":1532},{"type":17,"tag":63,"props":1618,"children":1619},{"style":87},[1620],{"type":22,"value":1537},{"type":17,"tag":63,"props":1622,"children":1623},{"style":70},[1624],{"type":22,"value":279},{"type":17,"tag":63,"props":1626,"children":1627},{"class":65,"line":499},[1628,1632,1637,1641,1646,1650,1655,1659,1663,1667,1671,1676],{"type":17,"tag":63,"props":1629,"children":1630},{"style":70},[1631],{"type":22,"value":1460},{"type":17,"tag":63,"props":1633,"children":1634},{"style":76},[1635],{"type":22,"value":1636},"newPeriod ",{"type":17,"tag":63,"props":1638,"children":1639},{"style":70},[1640],{"type":22,"value":84},{"type":17,"tag":63,"props":1642,"children":1643},{"style":182},[1644],{"type":22,"value":1645}," CarbonPeriod",{"type":17,"tag":63,"props":1647,"children":1648},{"style":70},[1649],{"type":22,"value":190},{"type":17,"tag":63,"props":1651,"children":1652},{"style":87},[1653],{"type":22,"value":1654},"create",{"type":17,"tag":63,"props":1656,"children":1657},{"style":70},[1658],{"type":22,"value":337},{"type":17,"tag":63,"props":1660,"children":1661},{"style":76},[1662],{"type":22,"value":170},{"type":17,"tag":63,"props":1664,"children":1665},{"style":70},[1666],{"type":22,"value":910},{"type":17,"tag":63,"props":1668,"children":1669},{"style":70},[1670],{"type":22,"value":152},{"type":17,"tag":63,"props":1672,"children":1673},{"style":76},[1674],{"type":22,"value":1675},"end",{"type":17,"tag":63,"props":1677,"children":1678},{"style":70},[1679],{"type":22,"value":229},{"type":17,"tag":63,"props":1681,"children":1682},{"class":65,"line":584},[1683,1687,1692,1696],{"type":17,"tag":63,"props":1684,"children":1685},{"style":70},[1686],{"type":22,"value":1460},{"type":17,"tag":63,"props":1688,"children":1689},{"style":76},[1690],{"type":22,"value":1691},"overlap ",{"type":17,"tag":63,"props":1693,"children":1694},{"style":70},[1695],{"type":22,"value":84},{"type":17,"tag":63,"props":1697,"children":1698},{"style":70},[1699],{"type":22,"value":1700}," false;\n",{"type":17,"tag":63,"props":1702,"children":1703},{"class":65,"line":731},[1704,1709,1713,1717,1721,1725,1730,1735,1739,1744,1748],{"type":17,"tag":63,"props":1705,"children":1706},{"style":1418},[1707],{"type":22,"value":1708},"    foreach",{"type":17,"tag":63,"props":1710,"children":1711},{"style":70},[1712],{"type":22,"value":608},{"type":17,"tag":63,"props":1714,"children":1715},{"style":76},[1716],{"type":22,"value":1394},{"type":17,"tag":63,"props":1718,"children":1719},{"style":70},[1720],{"type":22,"value":1434},{"type":17,"tag":63,"props":1722,"children":1723},{"style":70},[1724],{"type":22,"value":152},{"type":17,"tag":63,"props":1726,"children":1727},{"style":76},[1728],{"type":22,"value":1729},"index ",{"type":17,"tag":63,"props":1731,"children":1732},{"style":70},[1733],{"type":22,"value":1734},"=>",{"type":17,"tag":63,"props":1736,"children":1737},{"style":70},[1738],{"type":22,"value":152},{"type":17,"tag":63,"props":1740,"children":1741},{"style":76},[1742],{"type":22,"value":1743},"period",{"type":17,"tag":63,"props":1745,"children":1746},{"style":70},[1747],{"type":22,"value":553},{"type":17,"tag":63,"props":1749,"children":1750},{"style":70},[1751],{"type":22,"value":1452},{"type":17,"tag":63,"props":1753,"children":1755},{"class":65,"line":1754},10,[1756,1761,1765,1770,1775,1780,1784,1788,1793],{"type":17,"tag":63,"props":1757,"children":1758},{"style":1418},[1759],{"type":22,"value":1760},"        if",{"type":17,"tag":63,"props":1762,"children":1763},{"style":70},[1764],{"type":22,"value":608},{"type":17,"tag":63,"props":1766,"children":1767},{"style":76},[1768],{"type":22,"value":1769},"newPeriod",{"type":17,"tag":63,"props":1771,"children":1772},{"style":70},[1773],{"type":22,"value":1774},"->",{"type":17,"tag":63,"props":1776,"children":1777},{"style":87},[1778],{"type":22,"value":1779},"overlaps",{"type":17,"tag":63,"props":1781,"children":1782},{"style":70},[1783],{"type":22,"value":337},{"type":17,"tag":63,"props":1785,"children":1786},{"style":76},[1787],{"type":22,"value":1743},{"type":17,"tag":63,"props":1789,"children":1790},{"style":70},[1791],{"type":22,"value":1792},"))",{"type":17,"tag":63,"props":1794,"children":1795},{"style":70},[1796],{"type":22,"value":1452},{"type":17,"tag":63,"props":1798,"children":1800},{"class":65,"line":1799},11,[1801,1806,1811,1816,1821,1825,1830,1834,1838,1842],{"type":17,"tag":63,"props":1802,"children":1803},{"style":70},[1804],{"type":22,"value":1805},"            $",{"type":17,"tag":63,"props":1807,"children":1808},{"style":76},[1809],{"type":22,"value":1810},"periods",{"type":17,"tag":63,"props":1812,"children":1813},{"style":70},[1814],{"type":22,"value":1815},"[$",{"type":17,"tag":63,"props":1817,"children":1818},{"style":76},[1819],{"type":22,"value":1820},"index",{"type":17,"tag":63,"props":1822,"children":1823},{"style":70},[1824],{"type":22,"value":688},{"type":17,"tag":63,"props":1826,"children":1827},{"style":70},[1828],{"type":22,"value":1829}," =",{"type":17,"tag":63,"props":1831,"children":1832},{"style":182},[1833],{"type":22,"value":1645},{"type":17,"tag":63,"props":1835,"children":1836},{"style":70},[1837],{"type":22,"value":190},{"type":17,"tag":63,"props":1839,"children":1840},{"style":87},[1841],{"type":22,"value":1654},{"type":17,"tag":63,"props":1843,"children":1844},{"style":70},[1845],{"type":22,"value":1846},"(\n",{"type":17,"tag":63,"props":1848,"children":1850},{"class":65,"line":1849},12,[1851,1856,1860,1864,1868,1873,1878,1882,1886,1890,1894],{"type":17,"tag":63,"props":1852,"children":1853},{"style":87},[1854],{"type":22,"value":1855},"                min",{"type":17,"tag":63,"props":1857,"children":1858},{"style":70},[1859],{"type":22,"value":337},{"type":17,"tag":63,"props":1861,"children":1862},{"style":76},[1863],{"type":22,"value":1743},{"type":17,"tag":63,"props":1865,"children":1866},{"style":70},[1867],{"type":22,"value":1774},{"type":17,"tag":63,"props":1869,"children":1870},{"style":87},[1871],{"type":22,"value":1872},"getStartDate",{"type":17,"tag":63,"props":1874,"children":1875},{"style":70},[1876],{"type":22,"value":1877},"(),",{"type":17,"tag":63,"props":1879,"children":1880},{"style":70},[1881],{"type":22,"value":152},{"type":17,"tag":63,"props":1883,"children":1884},{"style":76},[1885],{"type":22,"value":1769},{"type":17,"tag":63,"props":1887,"children":1888},{"style":70},[1889],{"type":22,"value":1774},{"type":17,"tag":63,"props":1891,"children":1892},{"style":87},[1893],{"type":22,"value":1872},{"type":17,"tag":63,"props":1895,"children":1896},{"style":70},[1897],{"type":22,"value":1898},"()),\n",{"type":17,"tag":63,"props":1900,"children":1902},{"class":65,"line":1901},13,[1903,1908,1912,1916,1920,1925,1929,1933,1937,1941,1945],{"type":17,"tag":63,"props":1904,"children":1905},{"style":87},[1906],{"type":22,"value":1907},"                max",{"type":17,"tag":63,"props":1909,"children":1910},{"style":70},[1911],{"type":22,"value":337},{"type":17,"tag":63,"props":1913,"children":1914},{"style":76},[1915],{"type":22,"value":1743},{"type":17,"tag":63,"props":1917,"children":1918},{"style":70},[1919],{"type":22,"value":1774},{"type":17,"tag":63,"props":1921,"children":1922},{"style":87},[1923],{"type":22,"value":1924},"getEndDate",{"type":17,"tag":63,"props":1926,"children":1927},{"style":70},[1928],{"type":22,"value":1877},{"type":17,"tag":63,"props":1930,"children":1931},{"style":70},[1932],{"type":22,"value":152},{"type":17,"tag":63,"props":1934,"children":1935},{"style":76},[1936],{"type":22,"value":1769},{"type":17,"tag":63,"props":1938,"children":1939},{"style":70},[1940],{"type":22,"value":1774},{"type":17,"tag":63,"props":1942,"children":1943},{"style":87},[1944],{"type":22,"value":1924},{"type":17,"tag":63,"props":1946,"children":1947},{"style":70},[1948],{"type":22,"value":1949},"())\n",{"type":17,"tag":63,"props":1951,"children":1953},{"class":65,"line":1952},14,[1954],{"type":17,"tag":63,"props":1955,"children":1956},{"style":70},[1957],{"type":22,"value":1958},"            );\n",{"type":17,"tag":63,"props":1960,"children":1962},{"class":65,"line":1961},15,[1963,1967,1971,1975],{"type":17,"tag":63,"props":1964,"children":1965},{"style":70},[1966],{"type":22,"value":1805},{"type":17,"tag":63,"props":1968,"children":1969},{"style":76},[1970],{"type":22,"value":1691},{"type":17,"tag":63,"props":1972,"children":1973},{"style":70},[1974],{"type":22,"value":84},{"type":17,"tag":63,"props":1976,"children":1977},{"style":70},[1978],{"type":22,"value":1979}," true;\n",{"type":17,"tag":63,"props":1981,"children":1983},{"class":65,"line":1982},16,[1984,1989],{"type":17,"tag":63,"props":1985,"children":1986},{"style":1418},[1987],{"type":22,"value":1988},"            break",{"type":17,"tag":63,"props":1990,"children":1991},{"style":70},[1992],{"type":22,"value":175},{"type":17,"tag":63,"props":1994,"children":1996},{"class":65,"line":1995},17,[1997],{"type":17,"tag":63,"props":1998,"children":1999},{"style":70},[2000],{"type":22,"value":2001},"        }\n",{"type":17,"tag":63,"props":2003,"children":2005},{"class":65,"line":2004},18,[2006],{"type":17,"tag":63,"props":2007,"children":2008},{"style":70},[2009],{"type":22,"value":2010},"    }\n",{"type":17,"tag":63,"props":2012,"children":2014},{"class":65,"line":2013},19,[2015,2020,2025,2030,2034],{"type":17,"tag":63,"props":2016,"children":2017},{"style":1418},[2018],{"type":22,"value":2019},"    if",{"type":17,"tag":63,"props":2021,"children":2022},{"style":70},[2023],{"type":22,"value":2024}," (!$",{"type":17,"tag":63,"props":2026,"children":2027},{"style":76},[2028],{"type":22,"value":2029},"overlap",{"type":17,"tag":63,"props":2031,"children":2032},{"style":70},[2033],{"type":22,"value":553},{"type":17,"tag":63,"props":2035,"children":2036},{"style":70},[2037],{"type":22,"value":1452},{"type":17,"tag":63,"props":2039,"children":2041},{"class":65,"line":2040},20,[2042,2047,2051,2056,2060,2064,2068],{"type":17,"tag":63,"props":2043,"children":2044},{"style":70},[2045],{"type":22,"value":2046},"        $",{"type":17,"tag":63,"props":2048,"children":2049},{"style":76},[2050],{"type":22,"value":1810},{"type":17,"tag":63,"props":2052,"children":2053},{"style":70},[2054],{"type":22,"value":2055},"[]",{"type":17,"tag":63,"props":2057,"children":2058},{"style":70},[2059],{"type":22,"value":1829},{"type":17,"tag":63,"props":2061,"children":2062},{"style":70},[2063],{"type":22,"value":152},{"type":17,"tag":63,"props":2065,"children":2066},{"style":76},[2067],{"type":22,"value":1769},{"type":17,"tag":63,"props":2069,"children":2070},{"style":70},[2071],{"type":22,"value":175},{"type":17,"tag":63,"props":2073,"children":2075},{"class":65,"line":2074},21,[2076],{"type":17,"tag":63,"props":2077,"children":2078},{"style":70},[2079],{"type":22,"value":2010},{"type":17,"tag":63,"props":2081,"children":2083},{"class":65,"line":2082},22,[2084],{"type":17,"tag":63,"props":2085,"children":2086},{"style":70},[2087],{"type":22,"value":2088},"}\n",{"type":17,"tag":63,"props":2090,"children":2092},{"class":65,"line":2091},23,[2093,2097,2101,2105,2109,2113,2117,2121],{"type":17,"tag":63,"props":2094,"children":2095},{"style":1418},[2096],{"type":22,"value":1421},{"type":17,"tag":63,"props":2098,"children":2099},{"style":70},[2100],{"type":22,"value":608},{"type":17,"tag":63,"props":2102,"children":2103},{"style":76},[2104],{"type":22,"value":1394},{"type":17,"tag":63,"props":2106,"children":2107},{"style":70},[2108],{"type":22,"value":1434},{"type":17,"tag":63,"props":2110,"children":2111},{"style":70},[2112],{"type":22,"value":152},{"type":17,"tag":63,"props":2114,"children":2115},{"style":76},[2116],{"type":22,"value":1743},{"type":17,"tag":63,"props":2118,"children":2119},{"style":70},[2120],{"type":22,"value":553},{"type":17,"tag":63,"props":2122,"children":2123},{"style":70},[2124],{"type":22,"value":1452},{"type":17,"tag":63,"props":2126,"children":2128},{"class":65,"line":2127},24,[2129,2133,2137,2141,2145,2149,2153,2157],{"type":17,"tag":63,"props":2130,"children":2131},{"style":70},[2132],{"type":22,"value":1460},{"type":17,"tag":63,"props":2134,"children":2135},{"style":76},[2136],{"type":22,"value":79},{"type":17,"tag":63,"props":2138,"children":2139},{"style":70},[2140],{"type":22,"value":84},{"type":17,"tag":63,"props":2142,"children":2143},{"style":70},[2144],{"type":22,"value":152},{"type":17,"tag":63,"props":2146,"children":2147},{"style":76},[2148],{"type":22,"value":1743},{"type":17,"tag":63,"props":2150,"children":2151},{"style":70},[2152],{"type":22,"value":1774},{"type":17,"tag":63,"props":2154,"children":2155},{"style":87},[2156],{"type":22,"value":1872},{"type":17,"tag":63,"props":2158,"children":2159},{"style":70},[2160],{"type":22,"value":279},{"type":17,"tag":63,"props":2162,"children":2164},{"class":65,"line":2163},25,[2165,2169,2173,2177,2181,2185,2189,2193],{"type":17,"tag":63,"props":2166,"children":2167},{"style":70},[2168],{"type":22,"value":1460},{"type":17,"tag":63,"props":2170,"children":2171},{"style":76},[2172],{"type":22,"value":118},{"type":17,"tag":63,"props":2174,"children":2175},{"style":70},[2176],{"type":22,"value":84},{"type":17,"tag":63,"props":2178,"children":2179},{"style":70},[2180],{"type":22,"value":152},{"type":17,"tag":63,"props":2182,"children":2183},{"style":76},[2184],{"type":22,"value":1743},{"type":17,"tag":63,"props":2186,"children":2187},{"style":70},[2188],{"type":22,"value":1774},{"type":17,"tag":63,"props":2190,"children":2191},{"style":87},[2192],{"type":22,"value":1924},{"type":17,"tag":63,"props":2194,"children":2195},{"style":70},[2196],{"type":22,"value":279},{"type":17,"tag":63,"props":2198,"children":2200},{"class":65,"line":2199},26,[2201,2205,2209,2214,2218,2222,2226,2231,2235,2239],{"type":17,"tag":63,"props":2202,"children":2203},{"style":70},[2204],{"type":22,"value":1460},{"type":17,"tag":63,"props":2206,"children":2207},{"style":76},[2208],{"type":22,"value":1369},{"type":17,"tag":63,"props":2210,"children":2211},{"style":70},[2212],{"type":22,"value":2213},"+=",{"type":17,"tag":63,"props":2215,"children":2216},{"style":70},[2217],{"type":22,"value":152},{"type":17,"tag":63,"props":2219,"children":2220},{"style":76},[2221],{"type":22,"value":170},{"type":17,"tag":63,"props":2223,"children":2224},{"style":70},[2225],{"type":22,"value":1774},{"type":17,"tag":63,"props":2227,"children":2228},{"style":87},[2229],{"type":22,"value":2230},"diffInMonths",{"type":17,"tag":63,"props":2232,"children":2233},{"style":70},[2234],{"type":22,"value":337},{"type":17,"tag":63,"props":2236,"children":2237},{"style":76},[2238],{"type":22,"value":1675},{"type":17,"tag":63,"props":2240,"children":2241},{"style":70},[2242],{"type":22,"value":229},{"type":17,"tag":63,"props":2244,"children":2246},{"class":65,"line":2245},27,[2247],{"type":17,"tag":63,"props":2248,"children":2249},{"style":70},[2250],{"type":22,"value":2088},{"type":17,"tag":63,"props":2252,"children":2254},{"class":65,"line":2253},28,[2255,2259,2264,2268,2272,2277,2281,2285,2289,2294,2300,2304,2309,2313,2317,2321,2326,2331,2335,2339,2344,2348],{"type":17,"tag":63,"props":2256,"children":2257},{"style":70},[2258],{"type":22,"value":73},{"type":17,"tag":63,"props":2260,"children":2261},{"style":76},[2262],{"type":22,"value":2263},"resumeData",{"type":17,"tag":63,"props":2265,"children":2266},{"style":70},[2267],{"type":22,"value":669},{"type":17,"tag":63,"props":2269,"children":2270},{"style":70},[2271],{"type":22,"value":674},{"type":17,"tag":63,"props":2273,"children":2274},{"style":208},[2275],{"type":22,"value":2276},"seniority",{"type":17,"tag":63,"props":2278,"children":2279},{"style":70},[2280],{"type":22,"value":674},{"type":17,"tag":63,"props":2282,"children":2283},{"style":70},[2284],{"type":22,"value":688},{"type":17,"tag":63,"props":2286,"children":2287},{"style":70},[2288],{"type":22,"value":1829},{"type":17,"tag":63,"props":2290,"children":2291},{"style":70},[2292],{"type":22,"value":2293}," [(",{"type":17,"tag":63,"props":2295,"children":2297},{"style":2296},"--shiki-default:#C792EA",[2298],{"type":22,"value":2299},"int",{"type":17,"tag":63,"props":2301,"children":2302},{"style":70},[2303],{"type":22,"value":553},{"type":17,"tag":63,"props":2305,"children":2306},{"style":87},[2307],{"type":22,"value":2308}," floor",{"type":17,"tag":63,"props":2310,"children":2311},{"style":70},[2312],{"type":22,"value":337},{"type":17,"tag":63,"props":2314,"children":2315},{"style":76},[2316],{"type":22,"value":1369},{"type":17,"tag":63,"props":2318,"children":2319},{"style":70},[2320],{"type":22,"value":617},{"type":17,"tag":63,"props":2322,"children":2323},{"style":561},[2324],{"type":22,"value":2325}," 12",{"type":17,"tag":63,"props":2327,"children":2328},{"style":70},[2329],{"type":22,"value":2330},"),",{"type":17,"tag":63,"props":2332,"children":2333},{"style":70},[2334],{"type":22,"value":152},{"type":17,"tag":63,"props":2336,"children":2337},{"style":76},[2338],{"type":22,"value":1369},{"type":17,"tag":63,"props":2340,"children":2341},{"style":70},[2342],{"type":22,"value":2343},"%",{"type":17,"tag":63,"props":2345,"children":2346},{"style":561},[2347],{"type":22,"value":2325},{"type":17,"tag":63,"props":2349,"children":2350},{"style":70},[2351],{"type":22,"value":1025},{"type":17,"tag":810,"props":2353,"children":2354},{},[2355],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":2357},[2358],{"id":1348,"depth":98,"text":1348},"content:article:coding:calculate-total-unique-date-range-in-php.md","article/coding/calculate-total-unique-date-range-in-php.md","article/coding/calculate-total-unique-date-range-in-php",{"_path":2363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":2364,"description":2365,"category":6,"createdAt":2366,"updatedAt":2366,"body":2367,"_type":821,"_id":2621,"_source":823,"_file":2622,"_stem":2623,"_extension":826},"/article/coding/delete-file-after-call-export-file-api-in-laravel","在 Laravel 中下載檔案 api 送出後刪除檔案","專案有兩隻 API 是去產生 zip 檔後，分別為寄送信件和回傳檔案給前端，寄送信件 API 有特別定義 Response 格式，因這兩隻產生檔案採共用 function 會產生檔案後放在 storage/app 內，但回傳檔案 API 本來我只想就回傳檔案就好不想真的存一份檔案在伺服器上，所以有套件是可以直接做一個串流回傳 zip 檔的，像是:","2024-07-04",{"type":14,"children":2368,"toc":2619},[2369,2382,2394,2399,2610,2615],{"type":17,"tag":18,"props":2370,"children":2371},{},[2372,2374,2380],{"type":22,"value":2373},"專案有兩隻 API 是去產生 zip 檔後，分別為寄送信件和回傳檔案給前端，寄送信件 API 有特別定義 Response 格式，因這兩隻產生檔案採共用 function 會產生檔案後放在 ",{"type":17,"tag":33,"props":2375,"children":2377},{"className":2376},[],[2378],{"type":22,"value":2379},"storage/app",{"type":22,"value":2381}," 內，但回傳檔案 API 本來我只想就回傳檔案就好不想真的存一份檔案在伺服器上，所以有套件是可以直接做一個串流回傳 zip 檔的，像是:",{"type":17,"tag":18,"props":2383,"children":2384},{},[2385],{"type":17,"tag":2386,"props":2387,"children":2392},"a",{"href":2388,"rel":2389,"target":2391},"https://github.com/maennchen/ZipStream-PHP",[2390],"nofollow","_blank",[2393],{"type":22,"value":2388},{"type":17,"tag":18,"props":2395,"children":2396},{},[2397],{"type":22,"value":2398},"但因為寫法共用的關係(我就懶)會讓寄送信件 API Response 會變成串流資料，所以這套件暫時不適合我的專案，那只好將檔案存放在伺服器上了，接下來要解決的是如何在回傳檔案 API 後刪除檔案，用排程定時刪嗎? 好像不太好，可能會將同時間進來的 Request 做好的檔案刪掉，有沒有比較好的方式呢，在早期官方文件(新版文件沒有)有提到這樣的功能:",{"type":17,"tag":53,"props":2400,"children":2402},{"className":55,"code":2401,"language":57,"meta":8,"style":8},"public function download(ExportValidation $request)\n{\n    // 將檔案儲存在 storage/app ...\n    $response = response()->download(storage_path('app') . '/' . $zipName . '.zip');\n    return $response->deleteFileAfterSend(true);\n}\n",[2403],{"type":17,"tag":33,"props":2404,"children":2405},{"__ignoreMap":8},[2406,2446,2454,2462,2573,2603],{"type":17,"tag":63,"props":2407,"children":2408},{"class":65,"line":66},[2409,2414,2419,2424,2428,2433,2437,2442],{"type":17,"tag":63,"props":2410,"children":2411},{"style":2296},[2412],{"type":22,"value":2413},"public",{"type":17,"tag":63,"props":2415,"children":2416},{"style":2296},[2417],{"type":22,"value":2418}," function",{"type":17,"tag":63,"props":2420,"children":2421},{"style":87},[2422],{"type":22,"value":2423}," download",{"type":17,"tag":63,"props":2425,"children":2426},{"style":70},[2427],{"type":22,"value":200},{"type":17,"tag":63,"props":2429,"children":2430},{"style":182},[2431],{"type":22,"value":2432},"ExportValidation",{"type":17,"tag":63,"props":2434,"children":2435},{"style":70},[2436],{"type":22,"value":152},{"type":17,"tag":63,"props":2438,"children":2439},{"style":76},[2440],{"type":22,"value":2441},"request",{"type":17,"tag":63,"props":2443,"children":2444},{"style":70},[2445],{"type":22,"value":347},{"type":17,"tag":63,"props":2447,"children":2448},{"class":65,"line":98},[2449],{"type":17,"tag":63,"props":2450,"children":2451},{"style":70},[2452],{"type":22,"value":2453},"{\n",{"type":17,"tag":63,"props":2455,"children":2456},{"class":65,"line":108},[2457],{"type":17,"tag":63,"props":2458,"children":2459},{"style":102},[2460],{"type":22,"value":2461},"    // 將檔案儲存在 storage/app ...\n",{"type":17,"tag":63,"props":2463,"children":2464},{"class":65,"line":133},[2465,2469,2474,2478,2483,2487,2492,2496,2501,2505,2509,2514,2518,2522,2526,2530,2534,2538,2542,2546,2551,2556,2560,2565,2569],{"type":17,"tag":63,"props":2466,"children":2467},{"style":70},[2468],{"type":22,"value":1460},{"type":17,"tag":63,"props":2470,"children":2471},{"style":76},[2472],{"type":22,"value":2473},"response ",{"type":17,"tag":63,"props":2475,"children":2476},{"style":70},[2477],{"type":22,"value":84},{"type":17,"tag":63,"props":2479,"children":2480},{"style":87},[2481],{"type":22,"value":2482}," response",{"type":17,"tag":63,"props":2484,"children":2485},{"style":70},[2486],{"type":22,"value":269},{"type":17,"tag":63,"props":2488,"children":2489},{"style":87},[2490],{"type":22,"value":2491},"download",{"type":17,"tag":63,"props":2493,"children":2494},{"style":70},[2495],{"type":22,"value":200},{"type":17,"tag":63,"props":2497,"children":2498},{"style":87},[2499],{"type":22,"value":2500},"storage_path",{"type":17,"tag":63,"props":2502,"children":2503},{"style":70},[2504],{"type":22,"value":200},{"type":17,"tag":63,"props":2506,"children":2507},{"style":70},[2508],{"type":22,"value":674},{"type":17,"tag":63,"props":2510,"children":2511},{"style":208},[2512],{"type":22,"value":2513},"app",{"type":17,"tag":63,"props":2515,"children":2516},{"style":70},[2517],{"type":22,"value":674},{"type":17,"tag":63,"props":2519,"children":2520},{"style":70},[2521],{"type":22,"value":553},{"type":17,"tag":63,"props":2523,"children":2524},{"style":70},[2525],{"type":22,"value":526},{"type":17,"tag":63,"props":2527,"children":2528},{"style":70},[2529],{"type":22,"value":896},{"type":17,"tag":63,"props":2531,"children":2532},{"style":208},[2533],{"type":22,"value":617},{"type":17,"tag":63,"props":2535,"children":2536},{"style":70},[2537],{"type":22,"value":674},{"type":17,"tag":63,"props":2539,"children":2540},{"style":70},[2541],{"type":22,"value":526},{"type":17,"tag":63,"props":2543,"children":2544},{"style":70},[2545],{"type":22,"value":152},{"type":17,"tag":63,"props":2547,"children":2548},{"style":76},[2549],{"type":22,"value":2550},"zipName ",{"type":17,"tag":63,"props":2552,"children":2553},{"style":70},[2554],{"type":22,"value":2555},".",{"type":17,"tag":63,"props":2557,"children":2558},{"style":70},[2559],{"type":22,"value":896},{"type":17,"tag":63,"props":2561,"children":2562},{"style":208},[2563],{"type":22,"value":2564},".zip",{"type":17,"tag":63,"props":2566,"children":2567},{"style":70},[2568],{"type":22,"value":674},{"type":17,"tag":63,"props":2570,"children":2571},{"style":70},[2572],{"type":22,"value":229},{"type":17,"tag":63,"props":2574,"children":2575},{"class":65,"line":178},[2576,2581,2585,2590,2594,2599],{"type":17,"tag":63,"props":2577,"children":2578},{"style":1418},[2579],{"type":22,"value":2580},"    return",{"type":17,"tag":63,"props":2582,"children":2583},{"style":70},[2584],{"type":22,"value":152},{"type":17,"tag":63,"props":2586,"children":2587},{"style":76},[2588],{"type":22,"value":2589},"response",{"type":17,"tag":63,"props":2591,"children":2592},{"style":70},[2593],{"type":22,"value":1774},{"type":17,"tag":63,"props":2595,"children":2596},{"style":87},[2597],{"type":22,"value":2598},"deleteFileAfterSend",{"type":17,"tag":63,"props":2600,"children":2601},{"style":70},[2602],{"type":22,"value":95},{"type":17,"tag":63,"props":2604,"children":2605},{"class":65,"line":474},[2606],{"type":17,"tag":63,"props":2607,"children":2608},{"style":70},[2609],{"type":22,"value":2088},{"type":17,"tag":18,"props":2611,"children":2612},{},[2613],{"type":22,"value":2614},"這樣子可以直接回傳檔案後直接刪除，不需要排程另外刪囉！",{"type":17,"tag":810,"props":2616,"children":2617},{},[2618],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":2620},[],"content:article:coding:delete-file-after-call-export-file-api-in-laravel.md","article/coding/delete-file-after-call-export-file-api-in-laravel.md","article/coding/delete-file-after-call-export-file-api-in-laravel",{"_path":2625,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":2626,"description":2627,"category":6,"createdAt":2628,"updatedAt":2628,"body":2629,"_type":821,"_id":3097,"_source":823,"_file":3098,"_stem":3099,"_extension":826},"/article/coding/how-to-use-preg_replace_callback-in-php","php preg_replace_callback 客製替換文字用法","之前有個需求要將輸入的文字轉成客製想要的文字後回傳，此例也很難用一般的 preg_replace 做到，需求:","2024-06-30",{"type":14,"children":2630,"toc":3094},[2631,2635,2655,2660,2664,3085,3090],{"type":17,"tag":18,"props":2632,"children":2633},{},[2634],{"type":22,"value":2627},{"type":17,"tag":2636,"props":2637,"children":2638},"ul",{},[2639,2645,2650],{"type":17,"tag":2640,"props":2641,"children":2642},"li",{},[2643],{"type":22,"value":2644},"字串前兩個字母為英文大寫",{"type":17,"tag":2640,"props":2646,"children":2647},{},[2648],{"type":22,"value":2649},"第三位開始後面可能有長度小於 4 但想要用 0 補滿 4 位數字",{"type":17,"tag":2640,"props":2651,"children":2652},{},[2653],{"type":22,"value":2654},"最後一位可能有字母也可能沒有，有的話想要轉大寫",{"type":17,"tag":18,"props":2656,"children":2657},{},[2658],{"type":22,"value":2659},"即當輸入為 AA1D、AA01d、AA001D、...等輸出結果為 AA0001D。",{"type":17,"tag":24,"props":2661,"children":2662},{"id":1348},[2663],{"type":22,"value":1348},{"type":17,"tag":53,"props":2665,"children":2667},{"className":55,"code":2666,"language":57,"meta":8,"style":8},"$data = \"AA01\";\n\n$result = preg_replace_callback('/^([A-Z]{2})(\\d*)([A-Za-z]?)$/', function ($matches) {\n    $prefix = $matches[1];\n    $numberPart = str_pad($matches[2], 4, \"0\", STR_PAD_LEFT);\n    $lastChar = strtoupper($matches[3]);\n    return $prefix . $numberPart . $lastChar;\n}, $data);\n\necho $result;\n",[2668],{"type":17,"tag":33,"props":2669,"children":2670},{"__ignoreMap":8},[2671,2704,2711,2836,2873,2949,2992,3036,3057,3064],{"type":17,"tag":63,"props":2672,"children":2673},{"class":65,"line":66},[2674,2678,2683,2687,2691,2696,2700],{"type":17,"tag":63,"props":2675,"children":2676},{"style":70},[2677],{"type":22,"value":73},{"type":17,"tag":63,"props":2679,"children":2680},{"style":76},[2681],{"type":22,"value":2682},"data ",{"type":17,"tag":63,"props":2684,"children":2685},{"style":70},[2686],{"type":22,"value":84},{"type":17,"tag":63,"props":2688,"children":2689},{"style":70},[2690],{"type":22,"value":642},{"type":17,"tag":63,"props":2692,"children":2693},{"style":208},[2694],{"type":22,"value":2695},"AA01",{"type":17,"tag":63,"props":2697,"children":2698},{"style":70},[2699],{"type":22,"value":205},{"type":17,"tag":63,"props":2701,"children":2702},{"style":70},[2703],{"type":22,"value":175},{"type":17,"tag":63,"props":2705,"children":2706},{"class":65,"line":98},[2707],{"type":17,"tag":63,"props":2708,"children":2709},{"emptyLinePlaceholder":1409},[2710],{"type":22,"value":1412},{"type":17,"tag":63,"props":2712,"children":2713},{"class":65,"line":108},[2714,2718,2723,2727,2732,2736,2741,2745,2749,2754,2759,2764,2769,2774,2779,2784,2788,2792,2797,2801,2806,2811,2815,2819,2823,2828,2832],{"type":17,"tag":63,"props":2715,"children":2716},{"style":70},[2717],{"type":22,"value":73},{"type":17,"tag":63,"props":2719,"children":2720},{"style":76},[2721],{"type":22,"value":2722},"result ",{"type":17,"tag":63,"props":2724,"children":2725},{"style":70},[2726],{"type":22,"value":84},{"type":17,"tag":63,"props":2728,"children":2729},{"style":87},[2730],{"type":22,"value":2731}," preg_replace_callback",{"type":17,"tag":63,"props":2733,"children":2734},{"style":70},[2735],{"type":22,"value":200},{"type":17,"tag":63,"props":2737,"children":2738},{"style":70},[2739],{"type":22,"value":2740},"'/^",{"type":17,"tag":63,"props":2742,"children":2743},{"style":208},[2744],{"type":22,"value":200},{"type":17,"tag":63,"props":2746,"children":2747},{"style":70},[2748],{"type":22,"value":669},{"type":17,"tag":63,"props":2750,"children":2751},{"style":208},[2752],{"type":22,"value":2753},"A-Z",{"type":17,"tag":63,"props":2755,"children":2756},{"style":70},[2757],{"type":22,"value":2758},"]{",{"type":17,"tag":63,"props":2760,"children":2761},{"style":208},[2762],{"type":22,"value":2763},"2",{"type":17,"tag":63,"props":2765,"children":2766},{"style":70},[2767],{"type":22,"value":2768},"}",{"type":17,"tag":63,"props":2770,"children":2771},{"style":208},[2772],{"type":22,"value":2773},")(",{"type":17,"tag":63,"props":2775,"children":2776},{"style":76},[2777],{"type":22,"value":2778},"\\d",{"type":17,"tag":63,"props":2780,"children":2781},{"style":70},[2782],{"type":22,"value":2783},"*",{"type":17,"tag":63,"props":2785,"children":2786},{"style":208},[2787],{"type":22,"value":2773},{"type":17,"tag":63,"props":2789,"children":2790},{"style":70},[2791],{"type":22,"value":669},{"type":17,"tag":63,"props":2793,"children":2794},{"style":208},[2795],{"type":22,"value":2796},"A-Za-z",{"type":17,"tag":63,"props":2798,"children":2799},{"style":70},[2800],{"type":22,"value":688},{"type":17,"tag":63,"props":2802,"children":2803},{"style":208},[2804],{"type":22,"value":2805},"?)",{"type":17,"tag":63,"props":2807,"children":2808},{"style":70},[2809],{"type":22,"value":2810},"$/'",{"type":17,"tag":63,"props":2812,"children":2813},{"style":70},[2814],{"type":22,"value":910},{"type":17,"tag":63,"props":2816,"children":2817},{"style":2296},[2818],{"type":22,"value":2418},{"type":17,"tag":63,"props":2820,"children":2821},{"style":70},[2822],{"type":22,"value":608},{"type":17,"tag":63,"props":2824,"children":2825},{"style":76},[2826],{"type":22,"value":2827},"matches",{"type":17,"tag":63,"props":2829,"children":2830},{"style":70},[2831],{"type":22,"value":553},{"type":17,"tag":63,"props":2833,"children":2834},{"style":70},[2835],{"type":22,"value":1452},{"type":17,"tag":63,"props":2837,"children":2838},{"class":65,"line":133},[2839,2843,2848,2852,2856,2860,2864,2869],{"type":17,"tag":63,"props":2840,"children":2841},{"style":70},[2842],{"type":22,"value":1460},{"type":17,"tag":63,"props":2844,"children":2845},{"style":76},[2846],{"type":22,"value":2847},"prefix ",{"type":17,"tag":63,"props":2849,"children":2850},{"style":70},[2851],{"type":22,"value":84},{"type":17,"tag":63,"props":2853,"children":2854},{"style":70},[2855],{"type":22,"value":152},{"type":17,"tag":63,"props":2857,"children":2858},{"style":76},[2859],{"type":22,"value":2827},{"type":17,"tag":63,"props":2861,"children":2862},{"style":70},[2863],{"type":22,"value":669},{"type":17,"tag":63,"props":2865,"children":2866},{"style":561},[2867],{"type":22,"value":2868},"1",{"type":17,"tag":63,"props":2870,"children":2871},{"style":70},[2872],{"type":22,"value":1025},{"type":17,"tag":63,"props":2874,"children":2875},{"class":65,"line":178},[2876,2880,2885,2889,2894,2898,2902,2906,2910,2914,2919,2923,2927,2932,2936,2940,2945],{"type":17,"tag":63,"props":2877,"children":2878},{"style":70},[2879],{"type":22,"value":1460},{"type":17,"tag":63,"props":2881,"children":2882},{"style":76},[2883],{"type":22,"value":2884},"numberPart ",{"type":17,"tag":63,"props":2886,"children":2887},{"style":70},[2888],{"type":22,"value":84},{"type":17,"tag":63,"props":2890,"children":2891},{"style":87},[2892],{"type":22,"value":2893}," str_pad",{"type":17,"tag":63,"props":2895,"children":2896},{"style":70},[2897],{"type":22,"value":337},{"type":17,"tag":63,"props":2899,"children":2900},{"style":76},[2901],{"type":22,"value":2827},{"type":17,"tag":63,"props":2903,"children":2904},{"style":70},[2905],{"type":22,"value":669},{"type":17,"tag":63,"props":2907,"children":2908},{"style":561},[2909],{"type":22,"value":2763},{"type":17,"tag":63,"props":2911,"children":2912},{"style":70},[2913],{"type":22,"value":945},{"type":17,"tag":63,"props":2915,"children":2916},{"style":561},[2917],{"type":22,"value":2918}," 4",{"type":17,"tag":63,"props":2920,"children":2921},{"style":70},[2922],{"type":22,"value":910},{"type":17,"tag":63,"props":2924,"children":2925},{"style":70},[2926],{"type":22,"value":642},{"type":17,"tag":63,"props":2928,"children":2929},{"style":208},[2930],{"type":22,"value":2931},"0",{"type":17,"tag":63,"props":2933,"children":2934},{"style":70},[2935],{"type":22,"value":205},{"type":17,"tag":63,"props":2937,"children":2938},{"style":70},[2939],{"type":22,"value":910},{"type":17,"tag":63,"props":2941,"children":2942},{"style":76},[2943],{"type":22,"value":2944}," STR_PAD_LEFT",{"type":17,"tag":63,"props":2946,"children":2947},{"style":70},[2948],{"type":22,"value":229},{"type":17,"tag":63,"props":2950,"children":2951},{"class":65,"line":474},[2952,2956,2961,2965,2970,2974,2978,2982,2987],{"type":17,"tag":63,"props":2953,"children":2954},{"style":70},[2955],{"type":22,"value":1460},{"type":17,"tag":63,"props":2957,"children":2958},{"style":76},[2959],{"type":22,"value":2960},"lastChar ",{"type":17,"tag":63,"props":2962,"children":2963},{"style":70},[2964],{"type":22,"value":84},{"type":17,"tag":63,"props":2966,"children":2967},{"style":87},[2968],{"type":22,"value":2969}," strtoupper",{"type":17,"tag":63,"props":2971,"children":2972},{"style":70},[2973],{"type":22,"value":337},{"type":17,"tag":63,"props":2975,"children":2976},{"style":76},[2977],{"type":22,"value":2827},{"type":17,"tag":63,"props":2979,"children":2980},{"style":70},[2981],{"type":22,"value":669},{"type":17,"tag":63,"props":2983,"children":2984},{"style":561},[2985],{"type":22,"value":2986},"3",{"type":17,"tag":63,"props":2988,"children":2989},{"style":70},[2990],{"type":22,"value":2991},"]);\n",{"type":17,"tag":63,"props":2993,"children":2994},{"class":65,"line":499},[2995,2999,3003,3007,3011,3015,3019,3023,3027,3032],{"type":17,"tag":63,"props":2996,"children":2997},{"style":1418},[2998],{"type":22,"value":2580},{"type":17,"tag":63,"props":3000,"children":3001},{"style":70},[3002],{"type":22,"value":152},{"type":17,"tag":63,"props":3004,"children":3005},{"style":76},[3006],{"type":22,"value":2847},{"type":17,"tag":63,"props":3008,"children":3009},{"style":70},[3010],{"type":22,"value":2555},{"type":17,"tag":63,"props":3012,"children":3013},{"style":70},[3014],{"type":22,"value":152},{"type":17,"tag":63,"props":3016,"children":3017},{"style":76},[3018],{"type":22,"value":2884},{"type":17,"tag":63,"props":3020,"children":3021},{"style":70},[3022],{"type":22,"value":2555},{"type":17,"tag":63,"props":3024,"children":3025},{"style":70},[3026],{"type":22,"value":152},{"type":17,"tag":63,"props":3028,"children":3029},{"style":76},[3030],{"type":22,"value":3031},"lastChar",{"type":17,"tag":63,"props":3033,"children":3034},{"style":70},[3035],{"type":22,"value":175},{"type":17,"tag":63,"props":3037,"children":3038},{"class":65,"line":584},[3039,3044,3048,3053],{"type":17,"tag":63,"props":3040,"children":3041},{"style":70},[3042],{"type":22,"value":3043},"},",{"type":17,"tag":63,"props":3045,"children":3046},{"style":70},[3047],{"type":22,"value":152},{"type":17,"tag":63,"props":3049,"children":3050},{"style":76},[3051],{"type":22,"value":3052},"data",{"type":17,"tag":63,"props":3054,"children":3055},{"style":70},[3056],{"type":22,"value":229},{"type":17,"tag":63,"props":3058,"children":3059},{"class":65,"line":731},[3060],{"type":17,"tag":63,"props":3061,"children":3062},{"emptyLinePlaceholder":1409},[3063],{"type":22,"value":1412},{"type":17,"tag":63,"props":3065,"children":3066},{"class":65,"line":1754},[3067,3072,3076,3081],{"type":17,"tag":63,"props":3068,"children":3069},{"style":87},[3070],{"type":22,"value":3071},"echo",{"type":17,"tag":63,"props":3073,"children":3074},{"style":70},[3075],{"type":22,"value":152},{"type":17,"tag":63,"props":3077,"children":3078},{"style":76},[3079],{"type":22,"value":3080},"result",{"type":17,"tag":63,"props":3082,"children":3083},{"style":70},[3084],{"type":22,"value":175},{"type":17,"tag":18,"props":3086,"children":3087},{},[3088],{"type":22,"value":3089},"輸出結果為: AA0001",{"type":17,"tag":810,"props":3091,"children":3092},{},[3093],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":3095},[3096],{"id":1348,"depth":98,"text":1348},"content:article:coding:how-to-use-preg_replace_callback-in-php.md","article/coding/how-to-use-preg_replace_callback-in-php.md","article/coding/how-to-use-preg_replace_callback-in-php",{"_path":3101,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":3102,"description":3103,"category":6,"createdAt":3104,"updatedAt":3104,"body":3105,"_type":821,"_id":4685,"_source":823,"_file":4686,"_stem":4687,"_extension":826},"/article/coding/resolve-error-from-phpunit-and-sqlite-by-refresh-database-in-laravel","解決在 Laravel 使用 PHPUnit + SQLite 的 RefreshDatabase 失敗問題","之前在做單元測試需要用到 RefreshDatabase 的時候，專案內部分的 migration 會讓 SQLite 噴錯無法順利執行，以下紀錄解決方法:","2024-05-10",{"type":14,"children":3106,"toc":4681},[3107,3111,3117,3128,3260,3265,3273,3285,3295,4341,4347,4356,4521,4525,4533,4538,4677],{"type":17,"tag":18,"props":3108,"children":3109},{},[3110],{"type":22,"value":3103},{"type":17,"tag":24,"props":3112,"children":3114},{"id":3113},"_1-sqlite-無法使用-drop-foreign-key",[3115],{"type":22,"value":3116},"1. SQLite 無法使用 drop foreign key",{"type":17,"tag":18,"props":3118,"children":3119},{},[3120,3126],{"type":17,"tag":33,"props":3121,"children":3123},{"className":3122},[],[3124],{"type":22,"value":3125},"database/migrations/xxx.php",{"type":22,"value":3127},":",{"type":17,"tag":53,"props":3129,"children":3131},{"code":3130,"language":57,"meta":8,"className":55,"style":8},"Schema::table('users', function(Blueprint $table) {\n    // ...\n    $table->dropForeign(['role_id']);\n});\n\n",[3132],{"type":17,"tag":33,"props":3133,"children":3134},{"__ignoreMap":8},[3135,3202,3210,3252],{"type":17,"tag":63,"props":3136,"children":3137},{"class":65,"line":66},[3138,3143,3147,3152,3156,3160,3165,3169,3173,3177,3181,3186,3190,3194,3198],{"type":17,"tag":63,"props":3139,"children":3140},{"style":182},[3141],{"type":22,"value":3142},"Schema",{"type":17,"tag":63,"props":3144,"children":3145},{"style":70},[3146],{"type":22,"value":190},{"type":17,"tag":63,"props":3148,"children":3149},{"style":87},[3150],{"type":22,"value":3151},"table",{"type":17,"tag":63,"props":3153,"children":3154},{"style":70},[3155],{"type":22,"value":200},{"type":17,"tag":63,"props":3157,"children":3158},{"style":70},[3159],{"type":22,"value":674},{"type":17,"tag":63,"props":3161,"children":3162},{"style":208},[3163],{"type":22,"value":3164},"users",{"type":17,"tag":63,"props":3166,"children":3167},{"style":70},[3168],{"type":22,"value":674},{"type":17,"tag":63,"props":3170,"children":3171},{"style":70},[3172],{"type":22,"value":910},{"type":17,"tag":63,"props":3174,"children":3175},{"style":2296},[3176],{"type":22,"value":2418},{"type":17,"tag":63,"props":3178,"children":3179},{"style":70},[3180],{"type":22,"value":200},{"type":17,"tag":63,"props":3182,"children":3183},{"style":182},[3184],{"type":22,"value":3185},"Blueprint",{"type":17,"tag":63,"props":3187,"children":3188},{"style":70},[3189],{"type":22,"value":152},{"type":17,"tag":63,"props":3191,"children":3192},{"style":76},[3193],{"type":22,"value":3151},{"type":17,"tag":63,"props":3195,"children":3196},{"style":70},[3197],{"type":22,"value":553},{"type":17,"tag":63,"props":3199,"children":3200},{"style":70},[3201],{"type":22,"value":1452},{"type":17,"tag":63,"props":3203,"children":3204},{"class":65,"line":98},[3205],{"type":17,"tag":63,"props":3206,"children":3207},{"style":102},[3208],{"type":22,"value":3209},"    // ...\n",{"type":17,"tag":63,"props":3211,"children":3212},{"class":65,"line":108},[3213,3217,3221,3225,3230,3235,3239,3244,3248],{"type":17,"tag":63,"props":3214,"children":3215},{"style":70},[3216],{"type":22,"value":1460},{"type":17,"tag":63,"props":3218,"children":3219},{"style":76},[3220],{"type":22,"value":3151},{"type":17,"tag":63,"props":3222,"children":3223},{"style":70},[3224],{"type":22,"value":1774},{"type":17,"tag":63,"props":3226,"children":3227},{"style":87},[3228],{"type":22,"value":3229},"dropForeign",{"type":17,"tag":63,"props":3231,"children":3232},{"style":70},[3233],{"type":22,"value":3234},"([",{"type":17,"tag":63,"props":3236,"children":3237},{"style":70},[3238],{"type":22,"value":674},{"type":17,"tag":63,"props":3240,"children":3241},{"style":208},[3242],{"type":22,"value":3243},"role_id",{"type":17,"tag":63,"props":3245,"children":3246},{"style":70},[3247],{"type":22,"value":674},{"type":17,"tag":63,"props":3249,"children":3250},{"style":70},[3251],{"type":22,"value":2991},{"type":17,"tag":63,"props":3253,"children":3254},{"class":65,"line":133},[3255],{"type":17,"tag":63,"props":3256,"children":3257},{"style":70},[3258],{"type":22,"value":3259},"});\n",{"type":17,"tag":18,"props":3261,"children":3262},{},[3263],{"type":22,"value":3264},"錯誤訊息:",{"type":17,"tag":53,"props":3266,"children":3268},{"code":3267},"BadMethodCallException: SQLite doesn't support dropping foreign keys (you would need to re-create the table).\n",[3269],{"type":17,"tag":33,"props":3270,"children":3271},{"__ignoreMap":8},[3272],{"type":22,"value":3267},{"type":17,"tag":18,"props":3274,"children":3275},{},[3276,3278],{"type":22,"value":3277},"解法參考: ",{"type":17,"tag":2386,"props":3279,"children":3282},{"href":3280,"rel":3281,"target":2391},"https://github.com/laravel/framework/issues/25475",[2390],[3283],{"type":22,"value":3284},"GitHub Laravel Issue",{"type":17,"tag":18,"props":3286,"children":3287},{},[3288,3294],{"type":17,"tag":33,"props":3289,"children":3291},{"className":3290},[],[3292],{"type":22,"value":3293},"tests/TestCase.php",{"type":22,"value":3127},{"type":17,"tag":53,"props":3296,"children":3298},{"code":3297,"language":57,"meta":8,"className":55,"style":8},"\u003C?php\n\nnamespace Tests;\n\nuse Closure;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Schema\\SQLiteBuilder;\nuse Illuminate\\Database\\SQLiteConnection;\nuse Illuminate\\Foundation\\Testing\\RefreshDatabase;\nuse Illuminate\\Foundation\\Testing\\TestCase as BaseTestCase;\n\nabstract class TestCase extends BaseTestCase\n{\n    use CreatesApplication;\n    use RefreshDatabase;\n\n    public function __construct()\n    {\n        parent::__construct();\n        $this->withoutForeign();\n    }\n\n    private function withoutForeign()\n    {\n        Connection::resolverFor('sqlite', function ($connection, $database, $prefix, $config) {\n            return new class($connection, $database, $prefix, $config) extends SQLiteConnection\n            {\n                public function getSchemaBuilder()\n                {\n                    if ($this->schemaGrammar === null) {\n                        $this->useDefaultSchemaGrammar();\n                    }\n                    return new class($this) extends SQLiteBuilder\n                    {\n                        protected function createBlueprint($table, Closure $callback = null)\n                        {\n                            return new class($table, $callback) extends Blueprint\n                            {\n                                public function dropForeign($index)\n                                {\n                                }\n                            };\n                        }\n                    };\n                }\n            };\n        });\n    }\n}\n\n",[3299],{"type":17,"tag":33,"props":3300,"children":3301},{"__ignoreMap":8},[3302,3315,3322,3339,3346,3363,3397,3436,3476,3508,3550,3600,3607,3635,3642,3659,3675,3682,3704,3712,3733,3750,3757,3764,3785,3792,3889,3963,3971,3993,4002,4035,4053,4062,4093,4102,4154,4163,4214,4223,4253,4262,4271,4280,4289,4298,4307,4316,4325,4333],{"type":17,"tag":63,"props":3303,"children":3304},{"class":65,"line":66},[3305,3310],{"type":17,"tag":63,"props":3306,"children":3307},{"style":70},[3308],{"type":22,"value":3309},"\u003C?",{"type":17,"tag":63,"props":3311,"children":3312},{"style":76},[3313],{"type":22,"value":3314},"php\n",{"type":17,"tag":63,"props":3316,"children":3317},{"class":65,"line":98},[3318],{"type":17,"tag":63,"props":3319,"children":3320},{"emptyLinePlaceholder":1409},[3321],{"type":22,"value":1412},{"type":17,"tag":63,"props":3323,"children":3324},{"class":65,"line":108},[3325,3330,3335],{"type":17,"tag":63,"props":3326,"children":3327},{"style":561},[3328],{"type":22,"value":3329},"namespace",{"type":17,"tag":63,"props":3331,"children":3332},{"style":182},[3333],{"type":22,"value":3334}," Tests",{"type":17,"tag":63,"props":3336,"children":3337},{"style":70},[3338],{"type":22,"value":175},{"type":17,"tag":63,"props":3340,"children":3341},{"class":65,"line":133},[3342],{"type":17,"tag":63,"props":3343,"children":3344},{"emptyLinePlaceholder":1409},[3345],{"type":22,"value":1412},{"type":17,"tag":63,"props":3347,"children":3348},{"class":65,"line":178},[3349,3354,3359],{"type":17,"tag":63,"props":3350,"children":3351},{"style":561},[3352],{"type":22,"value":3353},"use",{"type":17,"tag":63,"props":3355,"children":3356},{"style":76},[3357],{"type":22,"value":3358}," Closure",{"type":17,"tag":63,"props":3360,"children":3361},{"style":70},[3362],{"type":22,"value":175},{"type":17,"tag":63,"props":3364,"children":3365},{"class":65,"line":474},[3366,3370,3375,3379,3384,3388,3393],{"type":17,"tag":63,"props":3367,"children":3368},{"style":561},[3369],{"type":22,"value":3353},{"type":17,"tag":63,"props":3371,"children":3372},{"style":76},[3373],{"type":22,"value":3374}," Illuminate",{"type":17,"tag":63,"props":3376,"children":3377},{"style":70},[3378],{"type":22,"value":250},{"type":17,"tag":63,"props":3380,"children":3381},{"style":76},[3382],{"type":22,"value":3383},"Database",{"type":17,"tag":63,"props":3385,"children":3386},{"style":70},[3387],{"type":22,"value":250},{"type":17,"tag":63,"props":3389,"children":3390},{"style":76},[3391],{"type":22,"value":3392},"Connection",{"type":17,"tag":63,"props":3394,"children":3395},{"style":70},[3396],{"type":22,"value":175},{"type":17,"tag":63,"props":3398,"children":3399},{"class":65,"line":499},[3400,3404,3408,3412,3416,3420,3424,3428,3432],{"type":17,"tag":63,"props":3401,"children":3402},{"style":561},[3403],{"type":22,"value":3353},{"type":17,"tag":63,"props":3405,"children":3406},{"style":76},[3407],{"type":22,"value":3374},{"type":17,"tag":63,"props":3409,"children":3410},{"style":70},[3411],{"type":22,"value":250},{"type":17,"tag":63,"props":3413,"children":3414},{"style":76},[3415],{"type":22,"value":3383},{"type":17,"tag":63,"props":3417,"children":3418},{"style":70},[3419],{"type":22,"value":250},{"type":17,"tag":63,"props":3421,"children":3422},{"style":76},[3423],{"type":22,"value":3142},{"type":17,"tag":63,"props":3425,"children":3426},{"style":70},[3427],{"type":22,"value":250},{"type":17,"tag":63,"props":3429,"children":3430},{"style":76},[3431],{"type":22,"value":3185},{"type":17,"tag":63,"props":3433,"children":3434},{"style":70},[3435],{"type":22,"value":175},{"type":17,"tag":63,"props":3437,"children":3438},{"class":65,"line":584},[3439,3443,3447,3451,3455,3459,3463,3467,3472],{"type":17,"tag":63,"props":3440,"children":3441},{"style":561},[3442],{"type":22,"value":3353},{"type":17,"tag":63,"props":3444,"children":3445},{"style":76},[3446],{"type":22,"value":3374},{"type":17,"tag":63,"props":3448,"children":3449},{"style":70},[3450],{"type":22,"value":250},{"type":17,"tag":63,"props":3452,"children":3453},{"style":76},[3454],{"type":22,"value":3383},{"type":17,"tag":63,"props":3456,"children":3457},{"style":70},[3458],{"type":22,"value":250},{"type":17,"tag":63,"props":3460,"children":3461},{"style":76},[3462],{"type":22,"value":3142},{"type":17,"tag":63,"props":3464,"children":3465},{"style":70},[3466],{"type":22,"value":250},{"type":17,"tag":63,"props":3468,"children":3469},{"style":76},[3470],{"type":22,"value":3471},"SQLiteBuilder",{"type":17,"tag":63,"props":3473,"children":3474},{"style":70},[3475],{"type":22,"value":175},{"type":17,"tag":63,"props":3477,"children":3478},{"class":65,"line":731},[3479,3483,3487,3491,3495,3499,3504],{"type":17,"tag":63,"props":3480,"children":3481},{"style":561},[3482],{"type":22,"value":3353},{"type":17,"tag":63,"props":3484,"children":3485},{"style":76},[3486],{"type":22,"value":3374},{"type":17,"tag":63,"props":3488,"children":3489},{"style":70},[3490],{"type":22,"value":250},{"type":17,"tag":63,"props":3492,"children":3493},{"style":76},[3494],{"type":22,"value":3383},{"type":17,"tag":63,"props":3496,"children":3497},{"style":70},[3498],{"type":22,"value":250},{"type":17,"tag":63,"props":3500,"children":3501},{"style":76},[3502],{"type":22,"value":3503},"SQLiteConnection",{"type":17,"tag":63,"props":3505,"children":3506},{"style":70},[3507],{"type":22,"value":175},{"type":17,"tag":63,"props":3509,"children":3510},{"class":65,"line":1754},[3511,3515,3519,3523,3528,3532,3537,3541,3546],{"type":17,"tag":63,"props":3512,"children":3513},{"style":561},[3514],{"type":22,"value":3353},{"type":17,"tag":63,"props":3516,"children":3517},{"style":76},[3518],{"type":22,"value":3374},{"type":17,"tag":63,"props":3520,"children":3521},{"style":70},[3522],{"type":22,"value":250},{"type":17,"tag":63,"props":3524,"children":3525},{"style":76},[3526],{"type":22,"value":3527},"Foundation",{"type":17,"tag":63,"props":3529,"children":3530},{"style":70},[3531],{"type":22,"value":250},{"type":17,"tag":63,"props":3533,"children":3534},{"style":76},[3535],{"type":22,"value":3536},"Testing",{"type":17,"tag":63,"props":3538,"children":3539},{"style":70},[3540],{"type":22,"value":250},{"type":17,"tag":63,"props":3542,"children":3543},{"style":76},[3544],{"type":22,"value":3545},"RefreshDatabase",{"type":17,"tag":63,"props":3547,"children":3548},{"style":70},[3549],{"type":22,"value":175},{"type":17,"tag":63,"props":3551,"children":3552},{"class":65,"line":1799},[3553,3557,3561,3565,3569,3573,3577,3581,3586,3591,3596],{"type":17,"tag":63,"props":3554,"children":3555},{"style":561},[3556],{"type":22,"value":3353},{"type":17,"tag":63,"props":3558,"children":3559},{"style":76},[3560],{"type":22,"value":3374},{"type":17,"tag":63,"props":3562,"children":3563},{"style":70},[3564],{"type":22,"value":250},{"type":17,"tag":63,"props":3566,"children":3567},{"style":76},[3568],{"type":22,"value":3527},{"type":17,"tag":63,"props":3570,"children":3571},{"style":70},[3572],{"type":22,"value":250},{"type":17,"tag":63,"props":3574,"children":3575},{"style":76},[3576],{"type":22,"value":3536},{"type":17,"tag":63,"props":3578,"children":3579},{"style":70},[3580],{"type":22,"value":250},{"type":17,"tag":63,"props":3582,"children":3583},{"style":76},[3584],{"type":22,"value":3585},"TestCase",{"type":17,"tag":63,"props":3587,"children":3588},{"style":561},[3589],{"type":22,"value":3590}," as",{"type":17,"tag":63,"props":3592,"children":3593},{"style":182},[3594],{"type":22,"value":3595}," BaseTestCase",{"type":17,"tag":63,"props":3597,"children":3598},{"style":70},[3599],{"type":22,"value":175},{"type":17,"tag":63,"props":3601,"children":3602},{"class":65,"line":1849},[3603],{"type":17,"tag":63,"props":3604,"children":3605},{"emptyLinePlaceholder":1409},[3606],{"type":22,"value":1412},{"type":17,"tag":63,"props":3608,"children":3609},{"class":65,"line":1901},[3610,3615,3620,3625,3630],{"type":17,"tag":63,"props":3611,"children":3612},{"style":2296},[3613],{"type":22,"value":3614},"abstract",{"type":17,"tag":63,"props":3616,"children":3617},{"style":2296},[3618],{"type":22,"value":3619}," class",{"type":17,"tag":63,"props":3621,"children":3622},{"style":182},[3623],{"type":22,"value":3624}," TestCase",{"type":17,"tag":63,"props":3626,"children":3627},{"style":2296},[3628],{"type":22,"value":3629}," extends",{"type":17,"tag":63,"props":3631,"children":3632},{"style":182},[3633],{"type":22,"value":3634}," BaseTestCase\n",{"type":17,"tag":63,"props":3636,"children":3637},{"class":65,"line":1952},[3638],{"type":17,"tag":63,"props":3639,"children":3640},{"style":70},[3641],{"type":22,"value":2453},{"type":17,"tag":63,"props":3643,"children":3644},{"class":65,"line":1961},[3645,3650,3655],{"type":17,"tag":63,"props":3646,"children":3647},{"style":561},[3648],{"type":22,"value":3649},"    use",{"type":17,"tag":63,"props":3651,"children":3652},{"style":76},[3653],{"type":22,"value":3654}," CreatesApplication",{"type":17,"tag":63,"props":3656,"children":3657},{"style":70},[3658],{"type":22,"value":175},{"type":17,"tag":63,"props":3660,"children":3661},{"class":65,"line":1982},[3662,3666,3671],{"type":17,"tag":63,"props":3663,"children":3664},{"style":561},[3665],{"type":22,"value":3649},{"type":17,"tag":63,"props":3667,"children":3668},{"style":76},[3669],{"type":22,"value":3670}," RefreshDatabase",{"type":17,"tag":63,"props":3672,"children":3673},{"style":70},[3674],{"type":22,"value":175},{"type":17,"tag":63,"props":3676,"children":3677},{"class":65,"line":1995},[3678],{"type":17,"tag":63,"props":3679,"children":3680},{"emptyLinePlaceholder":1409},[3681],{"type":22,"value":1412},{"type":17,"tag":63,"props":3683,"children":3684},{"class":65,"line":2004},[3685,3690,3694,3699],{"type":17,"tag":63,"props":3686,"children":3687},{"style":2296},[3688],{"type":22,"value":3689},"    public",{"type":17,"tag":63,"props":3691,"children":3692},{"style":2296},[3693],{"type":22,"value":2418},{"type":17,"tag":63,"props":3695,"children":3696},{"style":87},[3697],{"type":22,"value":3698}," __construct",{"type":17,"tag":63,"props":3700,"children":3701},{"style":70},[3702],{"type":22,"value":3703},"()\n",{"type":17,"tag":63,"props":3705,"children":3706},{"class":65,"line":2013},[3707],{"type":17,"tag":63,"props":3708,"children":3709},{"style":70},[3710],{"type":22,"value":3711},"    {\n",{"type":17,"tag":63,"props":3713,"children":3714},{"class":65,"line":2040},[3715,3720,3724,3729],{"type":17,"tag":63,"props":3716,"children":3717},{"style":2296},[3718],{"type":22,"value":3719},"        parent",{"type":17,"tag":63,"props":3721,"children":3722},{"style":70},[3723],{"type":22,"value":190},{"type":17,"tag":63,"props":3725,"children":3726},{"style":87},[3727],{"type":22,"value":3728},"__construct",{"type":17,"tag":63,"props":3730,"children":3731},{"style":70},[3732],{"type":22,"value":279},{"type":17,"tag":63,"props":3734,"children":3735},{"class":65,"line":2074},[3736,3741,3746],{"type":17,"tag":63,"props":3737,"children":3738},{"style":70},[3739],{"type":22,"value":3740},"        $this->",{"type":17,"tag":63,"props":3742,"children":3743},{"style":87},[3744],{"type":22,"value":3745},"withoutForeign",{"type":17,"tag":63,"props":3747,"children":3748},{"style":70},[3749],{"type":22,"value":279},{"type":17,"tag":63,"props":3751,"children":3752},{"class":65,"line":2082},[3753],{"type":17,"tag":63,"props":3754,"children":3755},{"style":70},[3756],{"type":22,"value":2010},{"type":17,"tag":63,"props":3758,"children":3759},{"class":65,"line":2091},[3760],{"type":17,"tag":63,"props":3761,"children":3762},{"emptyLinePlaceholder":1409},[3763],{"type":22,"value":1412},{"type":17,"tag":63,"props":3765,"children":3766},{"class":65,"line":2127},[3767,3772,3776,3781],{"type":17,"tag":63,"props":3768,"children":3769},{"style":2296},[3770],{"type":22,"value":3771},"    private",{"type":17,"tag":63,"props":3773,"children":3774},{"style":2296},[3775],{"type":22,"value":2418},{"type":17,"tag":63,"props":3777,"children":3778},{"style":87},[3779],{"type":22,"value":3780}," withoutForeign",{"type":17,"tag":63,"props":3782,"children":3783},{"style":70},[3784],{"type":22,"value":3703},{"type":17,"tag":63,"props":3786,"children":3787},{"class":65,"line":2163},[3788],{"type":17,"tag":63,"props":3789,"children":3790},{"style":70},[3791],{"type":22,"value":3711},{"type":17,"tag":63,"props":3793,"children":3794},{"class":65,"line":2199},[3795,3800,3804,3809,3813,3817,3822,3826,3830,3834,3838,3842,3846,3850,3855,3859,3863,3868,3872,3876,3881,3885],{"type":17,"tag":63,"props":3796,"children":3797},{"style":182},[3798],{"type":22,"value":3799},"        Connection",{"type":17,"tag":63,"props":3801,"children":3802},{"style":70},[3803],{"type":22,"value":190},{"type":17,"tag":63,"props":3805,"children":3806},{"style":87},[3807],{"type":22,"value":3808},"resolverFor",{"type":17,"tag":63,"props":3810,"children":3811},{"style":70},[3812],{"type":22,"value":200},{"type":17,"tag":63,"props":3814,"children":3815},{"style":70},[3816],{"type":22,"value":674},{"type":17,"tag":63,"props":3818,"children":3819},{"style":208},[3820],{"type":22,"value":3821},"sqlite",{"type":17,"tag":63,"props":3823,"children":3824},{"style":70},[3825],{"type":22,"value":674},{"type":17,"tag":63,"props":3827,"children":3828},{"style":70},[3829],{"type":22,"value":910},{"type":17,"tag":63,"props":3831,"children":3832},{"style":2296},[3833],{"type":22,"value":2418},{"type":17,"tag":63,"props":3835,"children":3836},{"style":70},[3837],{"type":22,"value":608},{"type":17,"tag":63,"props":3839,"children":3840},{"style":76},[3841],{"type":22,"value":264},{"type":17,"tag":63,"props":3843,"children":3844},{"style":70},[3845],{"type":22,"value":910},{"type":17,"tag":63,"props":3847,"children":3848},{"style":70},[3849],{"type":22,"value":152},{"type":17,"tag":63,"props":3851,"children":3852},{"style":76},[3853],{"type":22,"value":3854},"database",{"type":17,"tag":63,"props":3856,"children":3857},{"style":70},[3858],{"type":22,"value":910},{"type":17,"tag":63,"props":3860,"children":3861},{"style":70},[3862],{"type":22,"value":152},{"type":17,"tag":63,"props":3864,"children":3865},{"style":76},[3866],{"type":22,"value":3867},"prefix",{"type":17,"tag":63,"props":3869,"children":3870},{"style":70},[3871],{"type":22,"value":910},{"type":17,"tag":63,"props":3873,"children":3874},{"style":70},[3875],{"type":22,"value":152},{"type":17,"tag":63,"props":3877,"children":3878},{"style":76},[3879],{"type":22,"value":3880},"config",{"type":17,"tag":63,"props":3882,"children":3883},{"style":70},[3884],{"type":22,"value":553},{"type":17,"tag":63,"props":3886,"children":3887},{"style":70},[3888],{"type":22,"value":1452},{"type":17,"tag":63,"props":3890,"children":3891},{"class":65,"line":2245},[3892,3897,3902,3906,3910,3914,3918,3922,3926,3930,3934,3938,3942,3946,3950,3954,3958],{"type":17,"tag":63,"props":3893,"children":3894},{"style":1418},[3895],{"type":22,"value":3896},"            return",{"type":17,"tag":63,"props":3898,"children":3899},{"style":561},[3900],{"type":22,"value":3901}," new",{"type":17,"tag":63,"props":3903,"children":3904},{"style":2296},[3905],{"type":22,"value":3619},{"type":17,"tag":63,"props":3907,"children":3908},{"style":70},[3909],{"type":22,"value":337},{"type":17,"tag":63,"props":3911,"children":3912},{"style":76},[3913],{"type":22,"value":264},{"type":17,"tag":63,"props":3915,"children":3916},{"style":70},[3917],{"type":22,"value":910},{"type":17,"tag":63,"props":3919,"children":3920},{"style":70},[3921],{"type":22,"value":152},{"type":17,"tag":63,"props":3923,"children":3924},{"style":76},[3925],{"type":22,"value":3854},{"type":17,"tag":63,"props":3927,"children":3928},{"style":70},[3929],{"type":22,"value":910},{"type":17,"tag":63,"props":3931,"children":3932},{"style":70},[3933],{"type":22,"value":152},{"type":17,"tag":63,"props":3935,"children":3936},{"style":76},[3937],{"type":22,"value":3867},{"type":17,"tag":63,"props":3939,"children":3940},{"style":70},[3941],{"type":22,"value":910},{"type":17,"tag":63,"props":3943,"children":3944},{"style":70},[3945],{"type":22,"value":152},{"type":17,"tag":63,"props":3947,"children":3948},{"style":76},[3949],{"type":22,"value":3880},{"type":17,"tag":63,"props":3951,"children":3952},{"style":70},[3953],{"type":22,"value":553},{"type":17,"tag":63,"props":3955,"children":3956},{"style":2296},[3957],{"type":22,"value":3629},{"type":17,"tag":63,"props":3959,"children":3960},{"style":182},[3961],{"type":22,"value":3962}," SQLiteConnection\n",{"type":17,"tag":63,"props":3964,"children":3965},{"class":65,"line":2253},[3966],{"type":17,"tag":63,"props":3967,"children":3968},{"style":70},[3969],{"type":22,"value":3970},"            {\n",{"type":17,"tag":63,"props":3972,"children":3974},{"class":65,"line":3973},29,[3975,3980,3984,3989],{"type":17,"tag":63,"props":3976,"children":3977},{"style":2296},[3978],{"type":22,"value":3979},"                public",{"type":17,"tag":63,"props":3981,"children":3982},{"style":2296},[3983],{"type":22,"value":2418},{"type":17,"tag":63,"props":3985,"children":3986},{"style":87},[3987],{"type":22,"value":3988}," getSchemaBuilder",{"type":17,"tag":63,"props":3990,"children":3991},{"style":70},[3992],{"type":22,"value":3703},{"type":17,"tag":63,"props":3994,"children":3996},{"class":65,"line":3995},30,[3997],{"type":17,"tag":63,"props":3998,"children":3999},{"style":70},[4000],{"type":22,"value":4001},"                {\n",{"type":17,"tag":63,"props":4003,"children":4005},{"class":65,"line":4004},31,[4006,4011,4016,4021,4026,4031],{"type":17,"tag":63,"props":4007,"children":4008},{"style":1418},[4009],{"type":22,"value":4010},"                    if",{"type":17,"tag":63,"props":4012,"children":4013},{"style":70},[4014],{"type":22,"value":4015}," ($this->",{"type":17,"tag":63,"props":4017,"children":4018},{"style":76},[4019],{"type":22,"value":4020},"schemaGrammar ",{"type":17,"tag":63,"props":4022,"children":4023},{"style":70},[4024],{"type":22,"value":4025},"===",{"type":17,"tag":63,"props":4027,"children":4028},{"style":70},[4029],{"type":22,"value":4030}," null)",{"type":17,"tag":63,"props":4032,"children":4033},{"style":70},[4034],{"type":22,"value":1452},{"type":17,"tag":63,"props":4036,"children":4038},{"class":65,"line":4037},32,[4039,4044,4049],{"type":17,"tag":63,"props":4040,"children":4041},{"style":70},[4042],{"type":22,"value":4043},"                        $this->",{"type":17,"tag":63,"props":4045,"children":4046},{"style":87},[4047],{"type":22,"value":4048},"useDefaultSchemaGrammar",{"type":17,"tag":63,"props":4050,"children":4051},{"style":70},[4052],{"type":22,"value":279},{"type":17,"tag":63,"props":4054,"children":4056},{"class":65,"line":4055},33,[4057],{"type":17,"tag":63,"props":4058,"children":4059},{"style":70},[4060],{"type":22,"value":4061},"                    }\n",{"type":17,"tag":63,"props":4063,"children":4065},{"class":65,"line":4064},34,[4066,4071,4075,4079,4084,4088],{"type":17,"tag":63,"props":4067,"children":4068},{"style":1418},[4069],{"type":22,"value":4070},"                    return",{"type":17,"tag":63,"props":4072,"children":4073},{"style":561},[4074],{"type":22,"value":3901},{"type":17,"tag":63,"props":4076,"children":4077},{"style":2296},[4078],{"type":22,"value":3619},{"type":17,"tag":63,"props":4080,"children":4081},{"style":70},[4082],{"type":22,"value":4083},"($this)",{"type":17,"tag":63,"props":4085,"children":4086},{"style":2296},[4087],{"type":22,"value":3629},{"type":17,"tag":63,"props":4089,"children":4090},{"style":182},[4091],{"type":22,"value":4092}," SQLiteBuilder\n",{"type":17,"tag":63,"props":4094,"children":4096},{"class":65,"line":4095},35,[4097],{"type":17,"tag":63,"props":4098,"children":4099},{"style":70},[4100],{"type":22,"value":4101},"                    {\n",{"type":17,"tag":63,"props":4103,"children":4105},{"class":65,"line":4104},36,[4106,4111,4115,4120,4124,4128,4132,4136,4140,4145,4149],{"type":17,"tag":63,"props":4107,"children":4108},{"style":2296},[4109],{"type":22,"value":4110},"                        protected",{"type":17,"tag":63,"props":4112,"children":4113},{"style":2296},[4114],{"type":22,"value":2418},{"type":17,"tag":63,"props":4116,"children":4117},{"style":87},[4118],{"type":22,"value":4119}," createBlueprint",{"type":17,"tag":63,"props":4121,"children":4122},{"style":70},[4123],{"type":22,"value":337},{"type":17,"tag":63,"props":4125,"children":4126},{"style":76},[4127],{"type":22,"value":3151},{"type":17,"tag":63,"props":4129,"children":4130},{"style":70},[4131],{"type":22,"value":910},{"type":17,"tag":63,"props":4133,"children":4134},{"style":182},[4135],{"type":22,"value":3358},{"type":17,"tag":63,"props":4137,"children":4138},{"style":70},[4139],{"type":22,"value":152},{"type":17,"tag":63,"props":4141,"children":4142},{"style":76},[4143],{"type":22,"value":4144},"callback ",{"type":17,"tag":63,"props":4146,"children":4147},{"style":70},[4148],{"type":22,"value":84},{"type":17,"tag":63,"props":4150,"children":4151},{"style":70},[4152],{"type":22,"value":4153}," null)\n",{"type":17,"tag":63,"props":4155,"children":4157},{"class":65,"line":4156},37,[4158],{"type":17,"tag":63,"props":4159,"children":4160},{"style":70},[4161],{"type":22,"value":4162},"                        {\n",{"type":17,"tag":63,"props":4164,"children":4166},{"class":65,"line":4165},38,[4167,4172,4176,4180,4184,4188,4192,4196,4201,4205,4209],{"type":17,"tag":63,"props":4168,"children":4169},{"style":1418},[4170],{"type":22,"value":4171},"                            return",{"type":17,"tag":63,"props":4173,"children":4174},{"style":561},[4175],{"type":22,"value":3901},{"type":17,"tag":63,"props":4177,"children":4178},{"style":2296},[4179],{"type":22,"value":3619},{"type":17,"tag":63,"props":4181,"children":4182},{"style":70},[4183],{"type":22,"value":337},{"type":17,"tag":63,"props":4185,"children":4186},{"style":76},[4187],{"type":22,"value":3151},{"type":17,"tag":63,"props":4189,"children":4190},{"style":70},[4191],{"type":22,"value":910},{"type":17,"tag":63,"props":4193,"children":4194},{"style":70},[4195],{"type":22,"value":152},{"type":17,"tag":63,"props":4197,"children":4198},{"style":76},[4199],{"type":22,"value":4200},"callback",{"type":17,"tag":63,"props":4202,"children":4203},{"style":70},[4204],{"type":22,"value":553},{"type":17,"tag":63,"props":4206,"children":4207},{"style":2296},[4208],{"type":22,"value":3629},{"type":17,"tag":63,"props":4210,"children":4211},{"style":182},[4212],{"type":22,"value":4213}," Blueprint\n",{"type":17,"tag":63,"props":4215,"children":4217},{"class":65,"line":4216},39,[4218],{"type":17,"tag":63,"props":4219,"children":4220},{"style":70},[4221],{"type":22,"value":4222},"                            {\n",{"type":17,"tag":63,"props":4224,"children":4226},{"class":65,"line":4225},40,[4227,4232,4236,4241,4245,4249],{"type":17,"tag":63,"props":4228,"children":4229},{"style":2296},[4230],{"type":22,"value":4231},"                                public",{"type":17,"tag":63,"props":4233,"children":4234},{"style":2296},[4235],{"type":22,"value":2418},{"type":17,"tag":63,"props":4237,"children":4238},{"style":87},[4239],{"type":22,"value":4240}," dropForeign",{"type":17,"tag":63,"props":4242,"children":4243},{"style":70},[4244],{"type":22,"value":337},{"type":17,"tag":63,"props":4246,"children":4247},{"style":76},[4248],{"type":22,"value":1820},{"type":17,"tag":63,"props":4250,"children":4251},{"style":70},[4252],{"type":22,"value":347},{"type":17,"tag":63,"props":4254,"children":4256},{"class":65,"line":4255},41,[4257],{"type":17,"tag":63,"props":4258,"children":4259},{"style":70},[4260],{"type":22,"value":4261},"                                {\n",{"type":17,"tag":63,"props":4263,"children":4265},{"class":65,"line":4264},42,[4266],{"type":17,"tag":63,"props":4267,"children":4268},{"style":70},[4269],{"type":22,"value":4270},"                                }\n",{"type":17,"tag":63,"props":4272,"children":4274},{"class":65,"line":4273},43,[4275],{"type":17,"tag":63,"props":4276,"children":4277},{"style":70},[4278],{"type":22,"value":4279},"                            };\n",{"type":17,"tag":63,"props":4281,"children":4283},{"class":65,"line":4282},44,[4284],{"type":17,"tag":63,"props":4285,"children":4286},{"style":70},[4287],{"type":22,"value":4288},"                        }\n",{"type":17,"tag":63,"props":4290,"children":4292},{"class":65,"line":4291},45,[4293],{"type":17,"tag":63,"props":4294,"children":4295},{"style":70},[4296],{"type":22,"value":4297},"                    };\n",{"type":17,"tag":63,"props":4299,"children":4301},{"class":65,"line":4300},46,[4302],{"type":17,"tag":63,"props":4303,"children":4304},{"style":70},[4305],{"type":22,"value":4306},"                }\n",{"type":17,"tag":63,"props":4308,"children":4310},{"class":65,"line":4309},47,[4311],{"type":17,"tag":63,"props":4312,"children":4313},{"style":70},[4314],{"type":22,"value":4315},"            };\n",{"type":17,"tag":63,"props":4317,"children":4319},{"class":65,"line":4318},48,[4320],{"type":17,"tag":63,"props":4321,"children":4322},{"style":70},[4323],{"type":22,"value":4324},"        });\n",{"type":17,"tag":63,"props":4326,"children":4328},{"class":65,"line":4327},49,[4329],{"type":17,"tag":63,"props":4330,"children":4331},{"style":70},[4332],{"type":22,"value":2010},{"type":17,"tag":63,"props":4334,"children":4336},{"class":65,"line":4335},50,[4337],{"type":17,"tag":63,"props":4338,"children":4339},{"style":70},[4340],{"type":22,"value":2088},{"type":17,"tag":24,"props":4342,"children":4344},{"id":4343},"_2-在-sqlite-顯示無法-dropcolumn",[4345],{"type":22,"value":4346},"2. 在 SQLite 顯示無法 dropColumn",{"type":17,"tag":18,"props":4348,"children":4349},{},[4350,4355],{"type":17,"tag":33,"props":4351,"children":4353},{"className":4352},[],[4354],{"type":22,"value":3125},{"type":22,"value":3127},{"type":17,"tag":53,"props":4357,"children":4359},{"code":4358,"language":57,"meta":8,"className":55,"style":8},"Schema::table('users', function(Blueprint $table) {\n    // ...\n    $table->dropColumn('description');\n    $table->dropColumn('deleted_at');\n});\n\n",[4360],{"type":17,"tag":33,"props":4361,"children":4362},{"__ignoreMap":8},[4363,4426,4433,4474,4514],{"type":17,"tag":63,"props":4364,"children":4365},{"class":65,"line":66},[4366,4370,4374,4378,4382,4386,4390,4394,4398,4402,4406,4410,4414,4418,4422],{"type":17,"tag":63,"props":4367,"children":4368},{"style":182},[4369],{"type":22,"value":3142},{"type":17,"tag":63,"props":4371,"children":4372},{"style":70},[4373],{"type":22,"value":190},{"type":17,"tag":63,"props":4375,"children":4376},{"style":87},[4377],{"type":22,"value":3151},{"type":17,"tag":63,"props":4379,"children":4380},{"style":70},[4381],{"type":22,"value":200},{"type":17,"tag":63,"props":4383,"children":4384},{"style":70},[4385],{"type":22,"value":674},{"type":17,"tag":63,"props":4387,"children":4388},{"style":208},[4389],{"type":22,"value":3164},{"type":17,"tag":63,"props":4391,"children":4392},{"style":70},[4393],{"type":22,"value":674},{"type":17,"tag":63,"props":4395,"children":4396},{"style":70},[4397],{"type":22,"value":910},{"type":17,"tag":63,"props":4399,"children":4400},{"style":2296},[4401],{"type":22,"value":2418},{"type":17,"tag":63,"props":4403,"children":4404},{"style":70},[4405],{"type":22,"value":200},{"type":17,"tag":63,"props":4407,"children":4408},{"style":182},[4409],{"type":22,"value":3185},{"type":17,"tag":63,"props":4411,"children":4412},{"style":70},[4413],{"type":22,"value":152},{"type":17,"tag":63,"props":4415,"children":4416},{"style":76},[4417],{"type":22,"value":3151},{"type":17,"tag":63,"props":4419,"children":4420},{"style":70},[4421],{"type":22,"value":553},{"type":17,"tag":63,"props":4423,"children":4424},{"style":70},[4425],{"type":22,"value":1452},{"type":17,"tag":63,"props":4427,"children":4428},{"class":65,"line":98},[4429],{"type":17,"tag":63,"props":4430,"children":4431},{"style":102},[4432],{"type":22,"value":3209},{"type":17,"tag":63,"props":4434,"children":4435},{"class":65,"line":108},[4436,4440,4444,4448,4453,4457,4461,4466,4470],{"type":17,"tag":63,"props":4437,"children":4438},{"style":70},[4439],{"type":22,"value":1460},{"type":17,"tag":63,"props":4441,"children":4442},{"style":76},[4443],{"type":22,"value":3151},{"type":17,"tag":63,"props":4445,"children":4446},{"style":70},[4447],{"type":22,"value":1774},{"type":17,"tag":63,"props":4449,"children":4450},{"style":87},[4451],{"type":22,"value":4452},"dropColumn",{"type":17,"tag":63,"props":4454,"children":4455},{"style":70},[4456],{"type":22,"value":200},{"type":17,"tag":63,"props":4458,"children":4459},{"style":70},[4460],{"type":22,"value":674},{"type":17,"tag":63,"props":4462,"children":4463},{"style":208},[4464],{"type":22,"value":4465},"description",{"type":17,"tag":63,"props":4467,"children":4468},{"style":70},[4469],{"type":22,"value":674},{"type":17,"tag":63,"props":4471,"children":4472},{"style":70},[4473],{"type":22,"value":229},{"type":17,"tag":63,"props":4475,"children":4476},{"class":65,"line":133},[4477,4481,4485,4489,4493,4497,4501,4506,4510],{"type":17,"tag":63,"props":4478,"children":4479},{"style":70},[4480],{"type":22,"value":1460},{"type":17,"tag":63,"props":4482,"children":4483},{"style":76},[4484],{"type":22,"value":3151},{"type":17,"tag":63,"props":4486,"children":4487},{"style":70},[4488],{"type":22,"value":1774},{"type":17,"tag":63,"props":4490,"children":4491},{"style":87},[4492],{"type":22,"value":4452},{"type":17,"tag":63,"props":4494,"children":4495},{"style":70},[4496],{"type":22,"value":200},{"type":17,"tag":63,"props":4498,"children":4499},{"style":70},[4500],{"type":22,"value":674},{"type":17,"tag":63,"props":4502,"children":4503},{"style":208},[4504],{"type":22,"value":4505},"deleted_at",{"type":17,"tag":63,"props":4507,"children":4508},{"style":70},[4509],{"type":22,"value":674},{"type":17,"tag":63,"props":4511,"children":4512},{"style":70},[4513],{"type":22,"value":229},{"type":17,"tag":63,"props":4515,"children":4516},{"class":65,"line":178},[4517],{"type":17,"tag":63,"props":4518,"children":4519},{"style":70},[4520],{"type":22,"value":3259},{"type":17,"tag":18,"props":4522,"children":4523},{},[4524],{"type":22,"value":3264},{"type":17,"tag":53,"props":4526,"children":4528},{"code":4527},"BadMethodCallException: SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification.\n",[4529],{"type":17,"tag":33,"props":4530,"children":4531},{"__ignoreMap":8},[4532],{"type":22,"value":4527},{"type":17,"tag":18,"props":4534,"children":4535},{},[4536],{"type":22,"value":4537},"解法:\n將 migration 改為如下:",{"type":17,"tag":53,"props":4539,"children":4541},{"code":4540,"language":57,"meta":8,"className":55,"style":8},"Schema::table('users', function(Blueprint $table) {\n    // ...\n    $table->dropColumn(['description', 'deleted_at']);\n});\n\n",[4542],{"type":17,"tag":33,"props":4543,"children":4544},{"__ignoreMap":8},[4545,4608,4615,4670],{"type":17,"tag":63,"props":4546,"children":4547},{"class":65,"line":66},[4548,4552,4556,4560,4564,4568,4572,4576,4580,4584,4588,4592,4596,4600,4604],{"type":17,"tag":63,"props":4549,"children":4550},{"style":182},[4551],{"type":22,"value":3142},{"type":17,"tag":63,"props":4553,"children":4554},{"style":70},[4555],{"type":22,"value":190},{"type":17,"tag":63,"props":4557,"children":4558},{"style":87},[4559],{"type":22,"value":3151},{"type":17,"tag":63,"props":4561,"children":4562},{"style":70},[4563],{"type":22,"value":200},{"type":17,"tag":63,"props":4565,"children":4566},{"style":70},[4567],{"type":22,"value":674},{"type":17,"tag":63,"props":4569,"children":4570},{"style":208},[4571],{"type":22,"value":3164},{"type":17,"tag":63,"props":4573,"children":4574},{"style":70},[4575],{"type":22,"value":674},{"type":17,"tag":63,"props":4577,"children":4578},{"style":70},[4579],{"type":22,"value":910},{"type":17,"tag":63,"props":4581,"children":4582},{"style":2296},[4583],{"type":22,"value":2418},{"type":17,"tag":63,"props":4585,"children":4586},{"style":70},[4587],{"type":22,"value":200},{"type":17,"tag":63,"props":4589,"children":4590},{"style":182},[4591],{"type":22,"value":3185},{"type":17,"tag":63,"props":4593,"children":4594},{"style":70},[4595],{"type":22,"value":152},{"type":17,"tag":63,"props":4597,"children":4598},{"style":76},[4599],{"type":22,"value":3151},{"type":17,"tag":63,"props":4601,"children":4602},{"style":70},[4603],{"type":22,"value":553},{"type":17,"tag":63,"props":4605,"children":4606},{"style":70},[4607],{"type":22,"value":1452},{"type":17,"tag":63,"props":4609,"children":4610},{"class":65,"line":98},[4611],{"type":17,"tag":63,"props":4612,"children":4613},{"style":102},[4614],{"type":22,"value":3209},{"type":17,"tag":63,"props":4616,"children":4617},{"class":65,"line":108},[4618,4622,4626,4630,4634,4638,4642,4646,4650,4654,4658,4662,4666],{"type":17,"tag":63,"props":4619,"children":4620},{"style":70},[4621],{"type":22,"value":1460},{"type":17,"tag":63,"props":4623,"children":4624},{"style":76},[4625],{"type":22,"value":3151},{"type":17,"tag":63,"props":4627,"children":4628},{"style":70},[4629],{"type":22,"value":1774},{"type":17,"tag":63,"props":4631,"children":4632},{"style":87},[4633],{"type":22,"value":4452},{"type":17,"tag":63,"props":4635,"children":4636},{"style":70},[4637],{"type":22,"value":3234},{"type":17,"tag":63,"props":4639,"children":4640},{"style":70},[4641],{"type":22,"value":674},{"type":17,"tag":63,"props":4643,"children":4644},{"style":208},[4645],{"type":22,"value":4465},{"type":17,"tag":63,"props":4647,"children":4648},{"style":70},[4649],{"type":22,"value":674},{"type":17,"tag":63,"props":4651,"children":4652},{"style":70},[4653],{"type":22,"value":910},{"type":17,"tag":63,"props":4655,"children":4656},{"style":70},[4657],{"type":22,"value":896},{"type":17,"tag":63,"props":4659,"children":4660},{"style":208},[4661],{"type":22,"value":4505},{"type":17,"tag":63,"props":4663,"children":4664},{"style":70},[4665],{"type":22,"value":674},{"type":17,"tag":63,"props":4667,"children":4668},{"style":70},[4669],{"type":22,"value":2991},{"type":17,"tag":63,"props":4671,"children":4672},{"class":65,"line":133},[4673],{"type":17,"tag":63,"props":4674,"children":4675},{"style":70},[4676],{"type":22,"value":3259},{"type":17,"tag":810,"props":4678,"children":4679},{},[4680],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":4682},[4683,4684],{"id":3113,"depth":98,"text":3116},{"id":4343,"depth":98,"text":4346},"content:article:coding:resolve-error-from-phpunit-and-sqlite-by-refresh-database-in-laravel.md","article/coding/resolve-error-from-phpunit-and-sqlite-by-refresh-database-in-laravel.md","article/coding/resolve-error-from-phpunit-and-sqlite-by-refresh-database-in-laravel",{"_path":4689,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":4690,"description":4691,"category":6,"createdAt":4692,"updatedAt":4692,"body":4693,"_type":821,"_id":5324,"_source":823,"_file":5325,"_stem":5326,"_extension":826},"/article/coding/vue-nuxt-content-security-policy","Vue Nuxt 內容安全策略 CSP 資安設定","被弱掃工具掃出前端專案有資安風險，之前因為知道前端資安這水很深阿，想說要處理起來會很難很麻煩，但其實不會，一起來看看吧！","2024-02-04",{"type":14,"children":4694,"toc":5321},[4695,4699,4705,4742,5277,5290,5317],{"type":17,"tag":18,"props":4696,"children":4697},{},[4698],{"type":22,"value":4691},{"type":17,"tag":24,"props":4700,"children":4702},{"id":4701},"nuxt-2-設定",[4703],{"type":22,"value":4704},"Nuxt 2 設定",{"type":17,"tag":18,"props":4706,"children":4707},{},[4708,4710,4716,4718,4724,4726,4732,4734,4740],{"type":22,"value":4709},"內容安全策略 Content-Security-Policy(CSP) 可用來防禦 XSS 攻擊，在 Nuxt 2 中的 ",{"type":17,"tag":33,"props":4711,"children":4713},{"className":4712},[],[4714],{"type":22,"value":4715},"nuxt.config.js",{"type":22,"value":4717}," 確保 ",{"type":17,"tag":33,"props":4719,"children":4721},{"className":4720},[],[4722],{"type":22,"value":4723},"target",{"type":22,"value":4725}," 值為 ",{"type":17,"tag":33,"props":4727,"children":4729},{"className":4728},[],[4730],{"type":22,"value":4731},"server",{"type":22,"value":4733},"，然後在 ",{"type":17,"tag":33,"props":4735,"children":4737},{"className":4736},[],[4738],{"type":22,"value":4739},"csp",{"type":22,"value":4741}," 新增內容如下:",{"type":17,"tag":53,"props":4743,"children":4747},{"className":4744,"code":4745,"language":4746,"meta":8,"style":8},"language-js shiki shiki-themes material-theme-palenight","export default {\n  render: {\n    csp: {\n      reportOnly: false,\n      policies: {\n        'default-src': [\"'self'\", 'cdnjs.cloudflare.com', '*.your-domain.com', 'www.google-analytics.com', 'stats.g.doubleclick.net'],\n        'img-src': [\"'self'\", 'www.w3.org', 'data:', 'www.google-analytics.com'],\n        'style-src': [\"'self'\", 'cdnjs.cloudflare.com', \"'unsafe-inline'\"],\n        'script-src': [\"'self'\", 'www.google-analytics.com', 'www.googletagmanager.com'],\n        'frame-ancestors': [\"'self'\"],\n      }\n    }\n  },\n};\n\n","js",[4748],{"type":17,"tag":33,"props":4749,"children":4750},{"__ignoreMap":8},[4751,4768,4785,4801,4824,4840,4954,5048,5125,5202,5246,5254,5261,5269],{"type":17,"tag":63,"props":4752,"children":4753},{"class":65,"line":66},[4754,4759,4764],{"type":17,"tag":63,"props":4755,"children":4756},{"style":1418},[4757],{"type":22,"value":4758},"export",{"type":17,"tag":63,"props":4760,"children":4761},{"style":1418},[4762],{"type":22,"value":4763}," default",{"type":17,"tag":63,"props":4765,"children":4766},{"style":70},[4767],{"type":22,"value":1452},{"type":17,"tag":63,"props":4769,"children":4770},{"class":65,"line":98},[4771,4777,4781],{"type":17,"tag":63,"props":4772,"children":4774},{"style":4773},"--shiki-default:#F07178",[4775],{"type":22,"value":4776},"  render",{"type":17,"tag":63,"props":4778,"children":4779},{"style":70},[4780],{"type":22,"value":3127},{"type":17,"tag":63,"props":4782,"children":4783},{"style":70},[4784],{"type":22,"value":1452},{"type":17,"tag":63,"props":4786,"children":4787},{"class":65,"line":108},[4788,4793,4797],{"type":17,"tag":63,"props":4789,"children":4790},{"style":4773},[4791],{"type":22,"value":4792},"    csp",{"type":17,"tag":63,"props":4794,"children":4795},{"style":70},[4796],{"type":22,"value":3127},{"type":17,"tag":63,"props":4798,"children":4799},{"style":70},[4800],{"type":22,"value":1452},{"type":17,"tag":63,"props":4802,"children":4803},{"class":65,"line":133},[4804,4809,4813,4819],{"type":17,"tag":63,"props":4805,"children":4806},{"style":4773},[4807],{"type":22,"value":4808},"      reportOnly",{"type":17,"tag":63,"props":4810,"children":4811},{"style":70},[4812],{"type":22,"value":3127},{"type":17,"tag":63,"props":4814,"children":4816},{"style":4815},"--shiki-default:#FF9CAC",[4817],{"type":22,"value":4818}," false",{"type":17,"tag":63,"props":4820,"children":4821},{"style":70},[4822],{"type":22,"value":4823},",\n",{"type":17,"tag":63,"props":4825,"children":4826},{"class":65,"line":178},[4827,4832,4836],{"type":17,"tag":63,"props":4828,"children":4829},{"style":4773},[4830],{"type":22,"value":4831},"      policies",{"type":17,"tag":63,"props":4833,"children":4834},{"style":70},[4835],{"type":22,"value":3127},{"type":17,"tag":63,"props":4837,"children":4838},{"style":70},[4839],{"type":22,"value":1452},{"type":17,"tag":63,"props":4841,"children":4842},{"class":65,"line":474},[4843,4848,4853,4857,4861,4865,4869,4874,4878,4882,4886,4891,4895,4899,4903,4908,4912,4916,4920,4925,4929,4933,4937,4942,4946,4950],{"type":17,"tag":63,"props":4844,"children":4845},{"style":70},[4846],{"type":22,"value":4847},"        '",{"type":17,"tag":63,"props":4849,"children":4850},{"style":4773},[4851],{"type":22,"value":4852},"default-src",{"type":17,"tag":63,"props":4854,"children":4855},{"style":70},[4856],{"type":22,"value":674},{"type":17,"tag":63,"props":4858,"children":4859},{"style":70},[4860],{"type":22,"value":3127},{"type":17,"tag":63,"props":4862,"children":4863},{"style":76},[4864],{"type":22,"value":950},{"type":17,"tag":63,"props":4866,"children":4867},{"style":70},[4868],{"type":22,"value":205},{"type":17,"tag":63,"props":4870,"children":4871},{"style":208},[4872],{"type":22,"value":4873},"'self'",{"type":17,"tag":63,"props":4875,"children":4876},{"style":70},[4877],{"type":22,"value":205},{"type":17,"tag":63,"props":4879,"children":4880},{"style":70},[4881],{"type":22,"value":910},{"type":17,"tag":63,"props":4883,"children":4884},{"style":70},[4885],{"type":22,"value":896},{"type":17,"tag":63,"props":4887,"children":4888},{"style":208},[4889],{"type":22,"value":4890},"cdnjs.cloudflare.com",{"type":17,"tag":63,"props":4892,"children":4893},{"style":70},[4894],{"type":22,"value":674},{"type":17,"tag":63,"props":4896,"children":4897},{"style":70},[4898],{"type":22,"value":910},{"type":17,"tag":63,"props":4900,"children":4901},{"style":70},[4902],{"type":22,"value":896},{"type":17,"tag":63,"props":4904,"children":4905},{"style":208},[4906],{"type":22,"value":4907},"*.your-domain.com",{"type":17,"tag":63,"props":4909,"children":4910},{"style":70},[4911],{"type":22,"value":674},{"type":17,"tag":63,"props":4913,"children":4914},{"style":70},[4915],{"type":22,"value":910},{"type":17,"tag":63,"props":4917,"children":4918},{"style":70},[4919],{"type":22,"value":896},{"type":17,"tag":63,"props":4921,"children":4922},{"style":208},[4923],{"type":22,"value":4924},"www.google-analytics.com",{"type":17,"tag":63,"props":4926,"children":4927},{"style":70},[4928],{"type":22,"value":674},{"type":17,"tag":63,"props":4930,"children":4931},{"style":70},[4932],{"type":22,"value":910},{"type":17,"tag":63,"props":4934,"children":4935},{"style":70},[4936],{"type":22,"value":896},{"type":17,"tag":63,"props":4938,"children":4939},{"style":208},[4940],{"type":22,"value":4941},"stats.g.doubleclick.net",{"type":17,"tag":63,"props":4943,"children":4944},{"style":70},[4945],{"type":22,"value":674},{"type":17,"tag":63,"props":4947,"children":4948},{"style":76},[4949],{"type":22,"value":688},{"type":17,"tag":63,"props":4951,"children":4952},{"style":70},[4953],{"type":22,"value":4823},{"type":17,"tag":63,"props":4955,"children":4956},{"class":65,"line":499},[4957,4961,4966,4970,4974,4978,4982,4986,4990,4994,4998,5003,5007,5011,5015,5020,5024,5028,5032,5036,5040,5044],{"type":17,"tag":63,"props":4958,"children":4959},{"style":70},[4960],{"type":22,"value":4847},{"type":17,"tag":63,"props":4962,"children":4963},{"style":4773},[4964],{"type":22,"value":4965},"img-src",{"type":17,"tag":63,"props":4967,"children":4968},{"style":70},[4969],{"type":22,"value":674},{"type":17,"tag":63,"props":4971,"children":4972},{"style":70},[4973],{"type":22,"value":3127},{"type":17,"tag":63,"props":4975,"children":4976},{"style":76},[4977],{"type":22,"value":950},{"type":17,"tag":63,"props":4979,"children":4980},{"style":70},[4981],{"type":22,"value":205},{"type":17,"tag":63,"props":4983,"children":4984},{"style":208},[4985],{"type":22,"value":4873},{"type":17,"tag":63,"props":4987,"children":4988},{"style":70},[4989],{"type":22,"value":205},{"type":17,"tag":63,"props":4991,"children":4992},{"style":70},[4993],{"type":22,"value":910},{"type":17,"tag":63,"props":4995,"children":4996},{"style":70},[4997],{"type":22,"value":896},{"type":17,"tag":63,"props":4999,"children":5000},{"style":208},[5001],{"type":22,"value":5002},"www.w3.org",{"type":17,"tag":63,"props":5004,"children":5005},{"style":70},[5006],{"type":22,"value":674},{"type":17,"tag":63,"props":5008,"children":5009},{"style":70},[5010],{"type":22,"value":910},{"type":17,"tag":63,"props":5012,"children":5013},{"style":70},[5014],{"type":22,"value":896},{"type":17,"tag":63,"props":5016,"children":5017},{"style":208},[5018],{"type":22,"value":5019},"data:",{"type":17,"tag":63,"props":5021,"children":5022},{"style":70},[5023],{"type":22,"value":674},{"type":17,"tag":63,"props":5025,"children":5026},{"style":70},[5027],{"type":22,"value":910},{"type":17,"tag":63,"props":5029,"children":5030},{"style":70},[5031],{"type":22,"value":896},{"type":17,"tag":63,"props":5033,"children":5034},{"style":208},[5035],{"type":22,"value":4924},{"type":17,"tag":63,"props":5037,"children":5038},{"style":70},[5039],{"type":22,"value":674},{"type":17,"tag":63,"props":5041,"children":5042},{"style":76},[5043],{"type":22,"value":688},{"type":17,"tag":63,"props":5045,"children":5046},{"style":70},[5047],{"type":22,"value":4823},{"type":17,"tag":63,"props":5049,"children":5050},{"class":65,"line":584},[5051,5055,5060,5064,5068,5072,5076,5080,5084,5088,5092,5096,5100,5104,5108,5113,5117,5121],{"type":17,"tag":63,"props":5052,"children":5053},{"style":70},[5054],{"type":22,"value":4847},{"type":17,"tag":63,"props":5056,"children":5057},{"style":4773},[5058],{"type":22,"value":5059},"style-src",{"type":17,"tag":63,"props":5061,"children":5062},{"style":70},[5063],{"type":22,"value":674},{"type":17,"tag":63,"props":5065,"children":5066},{"style":70},[5067],{"type":22,"value":3127},{"type":17,"tag":63,"props":5069,"children":5070},{"style":76},[5071],{"type":22,"value":950},{"type":17,"tag":63,"props":5073,"children":5074},{"style":70},[5075],{"type":22,"value":205},{"type":17,"tag":63,"props":5077,"children":5078},{"style":208},[5079],{"type":22,"value":4873},{"type":17,"tag":63,"props":5081,"children":5082},{"style":70},[5083],{"type":22,"value":205},{"type":17,"tag":63,"props":5085,"children":5086},{"style":70},[5087],{"type":22,"value":910},{"type":17,"tag":63,"props":5089,"children":5090},{"style":70},[5091],{"type":22,"value":896},{"type":17,"tag":63,"props":5093,"children":5094},{"style":208},[5095],{"type":22,"value":4890},{"type":17,"tag":63,"props":5097,"children":5098},{"style":70},[5099],{"type":22,"value":674},{"type":17,"tag":63,"props":5101,"children":5102},{"style":70},[5103],{"type":22,"value":910},{"type":17,"tag":63,"props":5105,"children":5106},{"style":70},[5107],{"type":22,"value":642},{"type":17,"tag":63,"props":5109,"children":5110},{"style":208},[5111],{"type":22,"value":5112},"'unsafe-inline'",{"type":17,"tag":63,"props":5114,"children":5115},{"style":70},[5116],{"type":22,"value":205},{"type":17,"tag":63,"props":5118,"children":5119},{"style":76},[5120],{"type":22,"value":688},{"type":17,"tag":63,"props":5122,"children":5123},{"style":70},[5124],{"type":22,"value":4823},{"type":17,"tag":63,"props":5126,"children":5127},{"class":65,"line":731},[5128,5132,5137,5141,5145,5149,5153,5157,5161,5165,5169,5173,5177,5181,5185,5190,5194,5198],{"type":17,"tag":63,"props":5129,"children":5130},{"style":70},[5131],{"type":22,"value":4847},{"type":17,"tag":63,"props":5133,"children":5134},{"style":4773},[5135],{"type":22,"value":5136},"script-src",{"type":17,"tag":63,"props":5138,"children":5139},{"style":70},[5140],{"type":22,"value":674},{"type":17,"tag":63,"props":5142,"children":5143},{"style":70},[5144],{"type":22,"value":3127},{"type":17,"tag":63,"props":5146,"children":5147},{"style":76},[5148],{"type":22,"value":950},{"type":17,"tag":63,"props":5150,"children":5151},{"style":70},[5152],{"type":22,"value":205},{"type":17,"tag":63,"props":5154,"children":5155},{"style":208},[5156],{"type":22,"value":4873},{"type":17,"tag":63,"props":5158,"children":5159},{"style":70},[5160],{"type":22,"value":205},{"type":17,"tag":63,"props":5162,"children":5163},{"style":70},[5164],{"type":22,"value":910},{"type":17,"tag":63,"props":5166,"children":5167},{"style":70},[5168],{"type":22,"value":896},{"type":17,"tag":63,"props":5170,"children":5171},{"style":208},[5172],{"type":22,"value":4924},{"type":17,"tag":63,"props":5174,"children":5175},{"style":70},[5176],{"type":22,"value":674},{"type":17,"tag":63,"props":5178,"children":5179},{"style":70},[5180],{"type":22,"value":910},{"type":17,"tag":63,"props":5182,"children":5183},{"style":70},[5184],{"type":22,"value":896},{"type":17,"tag":63,"props":5186,"children":5187},{"style":208},[5188],{"type":22,"value":5189},"www.googletagmanager.com",{"type":17,"tag":63,"props":5191,"children":5192},{"style":70},[5193],{"type":22,"value":674},{"type":17,"tag":63,"props":5195,"children":5196},{"style":76},[5197],{"type":22,"value":688},{"type":17,"tag":63,"props":5199,"children":5200},{"style":70},[5201],{"type":22,"value":4823},{"type":17,"tag":63,"props":5203,"children":5204},{"class":65,"line":1754},[5205,5209,5214,5218,5222,5226,5230,5234,5238,5242],{"type":17,"tag":63,"props":5206,"children":5207},{"style":70},[5208],{"type":22,"value":4847},{"type":17,"tag":63,"props":5210,"children":5211},{"style":4773},[5212],{"type":22,"value":5213},"frame-ancestors",{"type":17,"tag":63,"props":5215,"children":5216},{"style":70},[5217],{"type":22,"value":674},{"type":17,"tag":63,"props":5219,"children":5220},{"style":70},[5221],{"type":22,"value":3127},{"type":17,"tag":63,"props":5223,"children":5224},{"style":76},[5225],{"type":22,"value":950},{"type":17,"tag":63,"props":5227,"children":5228},{"style":70},[5229],{"type":22,"value":205},{"type":17,"tag":63,"props":5231,"children":5232},{"style":208},[5233],{"type":22,"value":4873},{"type":17,"tag":63,"props":5235,"children":5236},{"style":70},[5237],{"type":22,"value":205},{"type":17,"tag":63,"props":5239,"children":5240},{"style":76},[5241],{"type":22,"value":688},{"type":17,"tag":63,"props":5243,"children":5244},{"style":70},[5245],{"type":22,"value":4823},{"type":17,"tag":63,"props":5247,"children":5248},{"class":65,"line":1799},[5249],{"type":17,"tag":63,"props":5250,"children":5251},{"style":70},[5252],{"type":22,"value":5253},"      }\n",{"type":17,"tag":63,"props":5255,"children":5256},{"class":65,"line":1849},[5257],{"type":17,"tag":63,"props":5258,"children":5259},{"style":70},[5260],{"type":22,"value":2010},{"type":17,"tag":63,"props":5262,"children":5263},{"class":65,"line":1901},[5264],{"type":17,"tag":63,"props":5265,"children":5266},{"style":70},[5267],{"type":22,"value":5268},"  },\n",{"type":17,"tag":63,"props":5270,"children":5271},{"class":65,"line":1952},[5272],{"type":17,"tag":63,"props":5273,"children":5274},{"style":70},[5275],{"type":22,"value":5276},"};\n",{"type":17,"tag":18,"props":5278,"children":5279},{},[5280,5282,5288],{"type":22,"value":5281},"這裡示範網站有使用第三方服務(ex: CDN、GA、...)的相關設定，將 ",{"type":17,"tag":33,"props":5283,"children":5285},{"className":5284},[],[5286],{"type":22,"value":5287},"your-domain.com",{"type":22,"value":5289}," 替換成前端網站的 domain。",{"type":17,"tag":18,"props":5291,"children":5292},{},[5293,5299,5301,5307,5309,5315],{"type":17,"tag":33,"props":5294,"children":5296},{"className":5295},[],[5297],{"type":22,"value":5298},"reportOnly",{"type":22,"value":5300}," 設定為 ",{"type":17,"tag":33,"props":5302,"children":5304},{"className":5303},[],[5305],{"type":22,"value":5306},"false",{"type":22,"value":5308}," 使不合規定的檔案忽略不載入，適合用在正式環境；設定為 ",{"type":17,"tag":33,"props":5310,"children":5312},{"className":5311},[],[5313],{"type":22,"value":5314},"true",{"type":22,"value":5316}," 時檔案依然會載入，但會將資源載入警告列在 console log 內，用在測試環境 debug 用。",{"type":17,"tag":810,"props":5318,"children":5319},{},[5320],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":5322},[5323],{"id":4701,"depth":98,"text":4704},"content:article:coding:vue-nuxt-content-security-policy.md","article/coding/vue-nuxt-content-security-policy.md","article/coding/vue-nuxt-content-security-policy",{"_path":5328,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":5329,"description":5330,"category":6,"createdAt":5331,"updatedAt":5332,"body":5333,"_type":821,"_id":5453,"_source":823,"_file":5454,"_stem":5455,"_extension":826},"/article/coding/what-is-icon-font","Icon Font 是什麼？要怎麼使用呢？","Icon Font 在現今網頁運用廣泛，用來輔助搭配文字等也能增加使用者介面的美感，那到底什麼是 Icon Font 呢? 它基本上就是把 icon 當作字體，放入相對應的代碼或指定的名稱，就能夠產生一個小圖示，以下圖 Font Awesome 為例，可以看到利用偽元素來將特定的 Unicode 轉換顯示成好看的圖示：","2023-08-21","2023-08-22",{"type":14,"children":5334,"toc":5451},[5335,5339,5344,5358,5415,5420,5424,5429,5433,5447],{"type":17,"tag":18,"props":5336,"children":5337},{},[5338],{"type":22,"value":5330},{"type":17,"tag":5340,"props":5341,"children":5343},"markdown-img",{"src":5342},"articles/what-is-icon-font-1.jpg",[],{"type":17,"tag":18,"props":5345,"children":5346},{},[5347,5349,5356],{"type":22,"value":5348},"要產出這樣的圖示也很簡單，可參考",{"type":17,"tag":2386,"props":5350,"children":5353},{"href":5351,"rel":5352,"target":2391},"https://fontawesome.com/",[2390],[5354],{"type":22,"value":5355},"官方網站",{"type":22,"value":5357},"如何用 NPM 或 Yarn 拉取圖示庫後，在 HTML 貼上如下：",{"type":17,"tag":53,"props":5359,"children":5363},{"className":5360,"code":5361,"language":5362,"meta":8,"style":8},"language-html shiki shiki-themes material-theme-palenight","\u003Ci class=\"fa-brands fa-docker\">\u003C/i>\n","html",[5364],{"type":17,"tag":33,"props":5365,"children":5366},{"__ignoreMap":8},[5367],{"type":17,"tag":63,"props":5368,"children":5369},{"class":65,"line":66},[5370,5375,5380,5384,5388,5392,5397,5401,5406,5410],{"type":17,"tag":63,"props":5371,"children":5372},{"style":70},[5373],{"type":22,"value":5374},"\u003C",{"type":17,"tag":63,"props":5376,"children":5377},{"style":4773},[5378],{"type":22,"value":5379},"i",{"type":17,"tag":63,"props":5381,"children":5382},{"style":2296},[5383],{"type":22,"value":3619},{"type":17,"tag":63,"props":5385,"children":5386},{"style":70},[5387],{"type":22,"value":84},{"type":17,"tag":63,"props":5389,"children":5390},{"style":70},[5391],{"type":22,"value":205},{"type":17,"tag":63,"props":5393,"children":5394},{"style":208},[5395],{"type":22,"value":5396},"fa-brands fa-docker",{"type":17,"tag":63,"props":5398,"children":5399},{"style":70},[5400],{"type":22,"value":205},{"type":17,"tag":63,"props":5402,"children":5403},{"style":70},[5404],{"type":22,"value":5405},">\u003C/",{"type":17,"tag":63,"props":5407,"children":5408},{"style":4773},[5409],{"type":22,"value":5379},{"type":17,"tag":63,"props":5411,"children":5412},{"style":70},[5413],{"type":22,"value":5414},">\n",{"type":17,"tag":18,"props":5416,"children":5417},{},[5418],{"type":22,"value":5419},"即可產生出 Docker 的 Icon！官方也推出一個蠻酷的功能，可根據你用的不同開發工具來引入：",{"type":17,"tag":5340,"props":5421,"children":5423},{"src":5422},"articles/what-is-icon-font-2.jpg",[],{"type":17,"tag":18,"props":5425,"children":5426},{},[5427],{"type":22,"value":5428},"以 Vue 為例，可使用 bind 功能來動態綁定想要的 Icon！",{"type":17,"tag":5340,"props":5430,"children":5432},{"src":5431},"articles/what-is-icon-font-3.jpg",[],{"type":17,"tag":18,"props":5434,"children":5435},{},[5436,5438,5445],{"type":22,"value":5437},"Icon Font 被當作文字一樣所以可以加上 CSS 像是加顏色，但同樣也跟文字一樣只能用單色，其他優點像是在顯示上縮放不會失真，更酷的是它還可以做到動畫效果(animation)，很不可思議吧！有興趣的人可以到",{"type":17,"tag":2386,"props":5439,"children":5442},{"href":5440,"rel":5441,"target":2391},"https://fontawesome.com/icons/docker?f=brands&s=solid",[2390],[5443],{"type":22,"value":5444},"官方網站的範例 Docker Icon",{"type":22,"value":5446},"看看實際動畫效果吧！",{"type":17,"tag":810,"props":5448,"children":5449},{},[5450],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":5452},[],"content:article:coding:what-is-icon-font.md","article/coding/what-is-icon-font.md","article/coding/what-is-icon-font",{"_path":5457,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":5458,"description":5459,"category":6,"createdAt":5460,"updatedAt":5460,"body":5461,"_type":821,"_id":5656,"_source":823,"_file":5657,"_stem":5658,"_extension":826},"/article/coding/deal-with-non-breaking-space","不換行空格處理","最近爬資料時遇到一個很奇怪的問題，拿到的資料字串前後都有空格，無法直接用 PHP 的 trim() 或是 str_replace() 拿掉空格，仔細排查了一下原來這是一個叫做不換行空格 Non-breaking space 的東西，知道這是啥東西之後就好辦了，以下兩種處理方式都可以:","2023-04-03",{"type":14,"children":5462,"toc":5654},[5463,5484,5499,5567,5581,5645,5650],{"type":17,"tag":18,"props":5464,"children":5465},{},[5466,5468,5474,5476,5482],{"type":22,"value":5467},"最近爬資料時遇到一個很奇怪的問題，拿到的資料字串前後都有空格，無法直接用 PHP 的 ",{"type":17,"tag":33,"props":5469,"children":5471},{"className":5470},[],[5472],{"type":22,"value":5473},"trim()",{"type":22,"value":5475}," 或是 ",{"type":17,"tag":33,"props":5477,"children":5479},{"className":5478},[],[5480],{"type":22,"value":5481},"str_replace()",{"type":22,"value":5483}," 拿掉空格，仔細排查了一下原來這是一個叫做不換行空格 Non-breaking space 的東西，知道這是啥東西之後就好辦了，以下兩種處理方式都可以:",{"type":17,"tag":5485,"props":5486,"children":5487},"ol",{},[5488],{"type":17,"tag":2640,"props":5489,"children":5490},{},[5491,5493],{"type":22,"value":5492},"UTF-8 編碼 ",{"type":17,"tag":33,"props":5494,"children":5496},{"className":5495},[],[5497],{"type":22,"value":5498},"C2 A0",{"type":17,"tag":53,"props":5500,"children":5502},{"className":55,"code":5501,"language":57,"meta":8,"style":8},"preg_replace(\"/\\xc2\\xa0/\", \"\", $firstChild->data);\n",[5503],{"type":17,"tag":33,"props":5504,"children":5505},{"__ignoreMap":8},[5506],{"type":17,"tag":63,"props":5507,"children":5508},{"class":65,"line":66},[5509,5514,5518,5523,5528,5533,5537,5542,5546,5550,5555,5559,5563],{"type":17,"tag":63,"props":5510,"children":5511},{"style":87},[5512],{"type":22,"value":5513},"preg_replace",{"type":17,"tag":63,"props":5515,"children":5516},{"style":70},[5517],{"type":22,"value":200},{"type":17,"tag":63,"props":5519,"children":5520},{"style":70},[5521],{"type":22,"value":5522},"\"/",{"type":17,"tag":63,"props":5524,"children":5525},{"style":76},[5526],{"type":22,"value":5527},"\\xc2\\xa0",{"type":17,"tag":63,"props":5529,"children":5530},{"style":70},[5531],{"type":22,"value":5532},"/\"",{"type":17,"tag":63,"props":5534,"children":5535},{"style":70},[5536],{"type":22,"value":910},{"type":17,"tag":63,"props":5538,"children":5539},{"style":70},[5540],{"type":22,"value":5541}," \"\"",{"type":17,"tag":63,"props":5543,"children":5544},{"style":70},[5545],{"type":22,"value":910},{"type":17,"tag":63,"props":5547,"children":5548},{"style":70},[5549],{"type":22,"value":152},{"type":17,"tag":63,"props":5551,"children":5552},{"style":76},[5553],{"type":22,"value":5554},"firstChild",{"type":17,"tag":63,"props":5556,"children":5557},{"style":70},[5558],{"type":22,"value":1774},{"type":17,"tag":63,"props":5560,"children":5561},{"style":76},[5562],{"type":22,"value":3052},{"type":17,"tag":63,"props":5564,"children":5565},{"style":70},[5566],{"type":22,"value":229},{"type":17,"tag":5485,"props":5568,"children":5569},{"start":98},[5570],{"type":17,"tag":2640,"props":5571,"children":5572},{},[5573,5575],{"type":22,"value":5574},"Unicode 編碼 ",{"type":17,"tag":33,"props":5576,"children":5578},{"className":5577},[],[5579],{"type":22,"value":5580},"U+00A0",{"type":17,"tag":53,"props":5582,"children":5584},{"className":55,"code":5583,"language":57,"meta":8,"style":8},"preg_replace(\"/\\x{00a0}/u\", \"\", $firstChild->data);\n",[5585],{"type":17,"tag":33,"props":5586,"children":5587},{"__ignoreMap":8},[5588],{"type":17,"tag":63,"props":5589,"children":5590},{"class":65,"line":66},[5591,5595,5599,5603,5608,5613,5617,5621,5625,5629,5633,5637,5641],{"type":17,"tag":63,"props":5592,"children":5593},{"style":87},[5594],{"type":22,"value":5513},{"type":17,"tag":63,"props":5596,"children":5597},{"style":70},[5598],{"type":22,"value":200},{"type":17,"tag":63,"props":5600,"children":5601},{"style":70},[5602],{"type":22,"value":5522},{"type":17,"tag":63,"props":5604,"children":5605},{"style":208},[5606],{"type":22,"value":5607},"\\x{00a0}",{"type":17,"tag":63,"props":5609,"children":5610},{"style":70},[5611],{"type":22,"value":5612},"/u\"",{"type":17,"tag":63,"props":5614,"children":5615},{"style":70},[5616],{"type":22,"value":910},{"type":17,"tag":63,"props":5618,"children":5619},{"style":70},[5620],{"type":22,"value":5541},{"type":17,"tag":63,"props":5622,"children":5623},{"style":70},[5624],{"type":22,"value":910},{"type":17,"tag":63,"props":5626,"children":5627},{"style":70},[5628],{"type":22,"value":152},{"type":17,"tag":63,"props":5630,"children":5631},{"style":76},[5632],{"type":22,"value":5554},{"type":17,"tag":63,"props":5634,"children":5635},{"style":70},[5636],{"type":22,"value":1774},{"type":17,"tag":63,"props":5638,"children":5639},{"style":76},[5640],{"type":22,"value":3052},{"type":17,"tag":63,"props":5642,"children":5643},{"style":70},[5644],{"type":22,"value":229},{"type":17,"tag":18,"props":5646,"children":5647},{},[5648],{"type":22,"value":5649},"這樣就移除掉空白了！",{"type":17,"tag":810,"props":5651,"children":5652},{},[5653],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":5655},[],"content:article:coding:deal-with-non-breaking-space.md","article/coding/deal-with-non-breaking-space.md","article/coding/deal-with-non-breaking-space",{"_path":5660,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":5661,"description":5662,"category":6,"createdAt":5663,"updatedAt":5663,"body":5664,"_type":821,"_id":6649,"_source":823,"_file":6650,"_stem":6651,"_extension":826},"/article/coding/record-of-upgrading-voyager-version-to-1.2","Voyager 升至 1.2 踩坑紀錄","公司舊專案因資安問題需要做升級，有個專案使用 Voyager 1.1 版本，我需要一路往上升上去，照著官方文件的步驟升級結果才升到 1.2，系統就各種噴錯，都是文件根本沒有提到的升版注意事項，本來我懶惰想直接丟這些錯誤訊息給谷歌大神，結果幾乎沒有相關說明，無奈之下本宮只好翻底層程式碼一個一個抓問題了，以下稍微紀錄一下要調整的部分:","2023-03-17",{"type":14,"children":5665,"toc":6638},[5666,5670,5676,5710,5714,5720,5724,5730,5734,5740,5745,6323,6327,6333,6337,6343,6354,6417,6422,6547,6551,6557,6576,6580,6586,6603,6607,6613,6630,6634],{"type":17,"tag":18,"props":5667,"children":5668},{},[5669],{"type":22,"value":5662},{"type":17,"tag":24,"props":5671,"children":5673},{"id":5672},"_1-改用-voyager-提供介面替代",[5674],{"type":22,"value":5675},"1. 改用 voyager 提供介面替代",{"type":17,"tag":18,"props":5677,"children":5678},{},[5679,5681,5687,5689,5695,5696,5702,5704],{"type":22,"value":5680},"已不支援 ",{"type":17,"tag":33,"props":5682,"children":5684},{"className":5683},[],[5685],{"type":22,"value":5686},"TCG\\Voyager\\Voyager::can()",{"type":22,"value":5688},", ",{"type":17,"tag":33,"props":5690,"children":5692},{"className":5691},[],[5693],{"type":22,"value":5694},"TCG\\Voyager\\Voyager::canOrAbort()",{"type":22,"value":5688},{"type":17,"tag":33,"props":5697,"children":5699},{"className":5698},[],[5700],{"type":22,"value":5701},"TCG\\Voyager\\Voyager::canOrFail()",{"type":22,"value":5703}," 相關語法，改用 ",{"type":17,"tag":33,"props":5705,"children":5707},{"className":5706},[],[5708],{"type":22,"value":5709},"Auth::user()->hasPermission()",{"type":17,"tag":5340,"props":5711,"children":5713},{"src":5712},"articles/record-of-upgrading-voyager-version-to-1.2-1.jpg",[],{"type":17,"tag":24,"props":5715,"children":5717},{"id":5716},"_2-原方法已被改寫不使用",[5718],{"type":22,"value":5719},"2. 原方法已被改寫，不使用",{"type":17,"tag":5340,"props":5721,"children":5723},{"src":5722},"articles/record-of-upgrading-voyager-version-to-1.2-2.jpg",[],{"type":17,"tag":24,"props":5725,"children":5727},{"id":5726},"_3-自行複製-voyager-同檔名檔案",[5728],{"type":22,"value":5729},"3. 自行複製 voyager 同檔名檔案",{"type":17,"tag":5340,"props":5731,"children":5733},{"src":5732},"articles/record-of-upgrading-voyager-version-to-1.2-3.jpg",[],{"type":17,"tag":24,"props":5735,"children":5737},{"id":5736},"_4-media-page-內容無法顯示",[5738],{"type":22,"value":5739},"4. Media Page 內容無法顯示",{"type":17,"tag":18,"props":5741,"children":5742},{},[5743],{"type":22,"value":5744},"在以下各檔案做調整:",{"type":17,"tag":53,"props":5746,"children":5748},{"className":55,"code":5747,"language":57,"meta":8,"style":8},"// config/filesystems.php \n\nreturn [\n    'disks' => [\n        'voyager' => [\n            'driver' => 'local',\n            'root' => public_path('storage'),\n            'url' => env('APP_URL').'/storage',\n            'visibility' => 'public',\n        ],\n    ],\n];\n\n// config/voyager.php\nreturn [\n    // ...\n    'storage' => [\n        'disk' => 'voyager',\n    ],\n    'media' => [\n        // ...\n        'path'                => '',\n    ],\n];\n\n// resources/views/vendor/voyager/master.blade.php\n\u003Cmeta name=\"assets-path\" content=\"{{ route('voyager.voyager_assets') }}\"/>\n// ...\n@include('voyager::media.manager')\n",[5749],{"type":17,"tag":33,"props":5750,"children":5751},{"__ignoreMap":8},[5752,5760,5767,5779,5804,5828,5866,5912,5976,6012,6020,6028,6035,6042,6050,6061,6068,6091,6127,6134,6158,6166,6196,6203,6210,6217,6225,6281,6289],{"type":17,"tag":63,"props":5753,"children":5754},{"class":65,"line":66},[5755],{"type":17,"tag":63,"props":5756,"children":5757},{"style":102},[5758],{"type":22,"value":5759},"// config/filesystems.php \n",{"type":17,"tag":63,"props":5761,"children":5762},{"class":65,"line":98},[5763],{"type":17,"tag":63,"props":5764,"children":5765},{"emptyLinePlaceholder":1409},[5766],{"type":22,"value":1412},{"type":17,"tag":63,"props":5768,"children":5769},{"class":65,"line":108},[5770,5775],{"type":17,"tag":63,"props":5771,"children":5772},{"style":1418},[5773],{"type":22,"value":5774},"return",{"type":17,"tag":63,"props":5776,"children":5777},{"style":70},[5778],{"type":22,"value":865},{"type":17,"tag":63,"props":5780,"children":5781},{"class":65,"line":133},[5782,5787,5792,5796,5800],{"type":17,"tag":63,"props":5783,"children":5784},{"style":70},[5785],{"type":22,"value":5786},"    '",{"type":17,"tag":63,"props":5788,"children":5789},{"style":208},[5790],{"type":22,"value":5791},"disks",{"type":17,"tag":63,"props":5793,"children":5794},{"style":70},[5795],{"type":22,"value":674},{"type":17,"tag":63,"props":5797,"children":5798},{"style":70},[5799],{"type":22,"value":891},{"type":17,"tag":63,"props":5801,"children":5802},{"style":70},[5803],{"type":22,"value":865},{"type":17,"tag":63,"props":5805,"children":5806},{"class":65,"line":178},[5807,5811,5816,5820,5824],{"type":17,"tag":63,"props":5808,"children":5809},{"style":70},[5810],{"type":22,"value":4847},{"type":17,"tag":63,"props":5812,"children":5813},{"style":208},[5814],{"type":22,"value":5815},"voyager",{"type":17,"tag":63,"props":5817,"children":5818},{"style":70},[5819],{"type":22,"value":674},{"type":17,"tag":63,"props":5821,"children":5822},{"style":70},[5823],{"type":22,"value":891},{"type":17,"tag":63,"props":5825,"children":5826},{"style":70},[5827],{"type":22,"value":865},{"type":17,"tag":63,"props":5829,"children":5830},{"class":65,"line":474},[5831,5836,5841,5845,5849,5853,5858,5862],{"type":17,"tag":63,"props":5832,"children":5833},{"style":70},[5834],{"type":22,"value":5835},"            '",{"type":17,"tag":63,"props":5837,"children":5838},{"style":208},[5839],{"type":22,"value":5840},"driver",{"type":17,"tag":63,"props":5842,"children":5843},{"style":70},[5844],{"type":22,"value":674},{"type":17,"tag":63,"props":5846,"children":5847},{"style":70},[5848],{"type":22,"value":891},{"type":17,"tag":63,"props":5850,"children":5851},{"style":70},[5852],{"type":22,"value":896},{"type":17,"tag":63,"props":5854,"children":5855},{"style":208},[5856],{"type":22,"value":5857},"local",{"type":17,"tag":63,"props":5859,"children":5860},{"style":70},[5861],{"type":22,"value":674},{"type":17,"tag":63,"props":5863,"children":5864},{"style":70},[5865],{"type":22,"value":4823},{"type":17,"tag":63,"props":5867,"children":5868},{"class":65,"line":499},[5869,5873,5877,5881,5885,5890,5894,5898,5903,5907],{"type":17,"tag":63,"props":5870,"children":5871},{"style":70},[5872],{"type":22,"value":5835},{"type":17,"tag":63,"props":5874,"children":5875},{"style":208},[5876],{"type":22,"value":14},{"type":17,"tag":63,"props":5878,"children":5879},{"style":70},[5880],{"type":22,"value":674},{"type":17,"tag":63,"props":5882,"children":5883},{"style":70},[5884],{"type":22,"value":891},{"type":17,"tag":63,"props":5886,"children":5887},{"style":87},[5888],{"type":22,"value":5889}," public_path",{"type":17,"tag":63,"props":5891,"children":5892},{"style":70},[5893],{"type":22,"value":200},{"type":17,"tag":63,"props":5895,"children":5896},{"style":70},[5897],{"type":22,"value":674},{"type":17,"tag":63,"props":5899,"children":5900},{"style":208},[5901],{"type":22,"value":5902},"storage",{"type":17,"tag":63,"props":5904,"children":5905},{"style":70},[5906],{"type":22,"value":674},{"type":17,"tag":63,"props":5908,"children":5909},{"style":70},[5910],{"type":22,"value":5911},"),\n",{"type":17,"tag":63,"props":5913,"children":5914},{"class":65,"line":584},[5915,5919,5924,5928,5932,5937,5941,5945,5950,5954,5958,5963,5968,5972],{"type":17,"tag":63,"props":5916,"children":5917},{"style":70},[5918],{"type":22,"value":5835},{"type":17,"tag":63,"props":5920,"children":5921},{"style":208},[5922],{"type":22,"value":5923},"url",{"type":17,"tag":63,"props":5925,"children":5926},{"style":70},[5927],{"type":22,"value":674},{"type":17,"tag":63,"props":5929,"children":5930},{"style":70},[5931],{"type":22,"value":891},{"type":17,"tag":63,"props":5933,"children":5934},{"style":87},[5935],{"type":22,"value":5936}," env",{"type":17,"tag":63,"props":5938,"children":5939},{"style":70},[5940],{"type":22,"value":200},{"type":17,"tag":63,"props":5942,"children":5943},{"style":70},[5944],{"type":22,"value":674},{"type":17,"tag":63,"props":5946,"children":5947},{"style":208},[5948],{"type":22,"value":5949},"APP_URL",{"type":17,"tag":63,"props":5951,"children":5952},{"style":70},[5953],{"type":22,"value":674},{"type":17,"tag":63,"props":5955,"children":5956},{"style":70},[5957],{"type":22,"value":553},{"type":17,"tag":63,"props":5959,"children":5960},{"style":70},[5961],{"type":22,"value":5962},".'",{"type":17,"tag":63,"props":5964,"children":5965},{"style":208},[5966],{"type":22,"value":5967},"/storage",{"type":17,"tag":63,"props":5969,"children":5970},{"style":70},[5971],{"type":22,"value":674},{"type":17,"tag":63,"props":5973,"children":5974},{"style":70},[5975],{"type":22,"value":4823},{"type":17,"tag":63,"props":5977,"children":5978},{"class":65,"line":731},[5979,5983,5988,5992,5996,6000,6004,6008],{"type":17,"tag":63,"props":5980,"children":5981},{"style":70},[5982],{"type":22,"value":5835},{"type":17,"tag":63,"props":5984,"children":5985},{"style":208},[5986],{"type":22,"value":5987},"visibility",{"type":17,"tag":63,"props":5989,"children":5990},{"style":70},[5991],{"type":22,"value":674},{"type":17,"tag":63,"props":5993,"children":5994},{"style":70},[5995],{"type":22,"value":891},{"type":17,"tag":63,"props":5997,"children":5998},{"style":70},[5999],{"type":22,"value":896},{"type":17,"tag":63,"props":6001,"children":6002},{"style":208},[6003],{"type":22,"value":2413},{"type":17,"tag":63,"props":6005,"children":6006},{"style":70},[6007],{"type":22,"value":674},{"type":17,"tag":63,"props":6009,"children":6010},{"style":70},[6011],{"type":22,"value":4823},{"type":17,"tag":63,"props":6013,"children":6014},{"class":65,"line":1754},[6015],{"type":17,"tag":63,"props":6016,"children":6017},{"style":70},[6018],{"type":22,"value":6019},"        ],\n",{"type":17,"tag":63,"props":6021,"children":6022},{"class":65,"line":1799},[6023],{"type":17,"tag":63,"props":6024,"children":6025},{"style":70},[6026],{"type":22,"value":6027},"    ],\n",{"type":17,"tag":63,"props":6029,"children":6030},{"class":65,"line":1849},[6031],{"type":17,"tag":63,"props":6032,"children":6033},{"style":70},[6034],{"type":22,"value":1025},{"type":17,"tag":63,"props":6036,"children":6037},{"class":65,"line":1901},[6038],{"type":17,"tag":63,"props":6039,"children":6040},{"emptyLinePlaceholder":1409},[6041],{"type":22,"value":1412},{"type":17,"tag":63,"props":6043,"children":6044},{"class":65,"line":1952},[6045],{"type":17,"tag":63,"props":6046,"children":6047},{"style":102},[6048],{"type":22,"value":6049},"// config/voyager.php\n",{"type":17,"tag":63,"props":6051,"children":6052},{"class":65,"line":1961},[6053,6057],{"type":17,"tag":63,"props":6054,"children":6055},{"style":1418},[6056],{"type":22,"value":5774},{"type":17,"tag":63,"props":6058,"children":6059},{"style":70},[6060],{"type":22,"value":865},{"type":17,"tag":63,"props":6062,"children":6063},{"class":65,"line":1982},[6064],{"type":17,"tag":63,"props":6065,"children":6066},{"style":102},[6067],{"type":22,"value":3209},{"type":17,"tag":63,"props":6069,"children":6070},{"class":65,"line":1995},[6071,6075,6079,6083,6087],{"type":17,"tag":63,"props":6072,"children":6073},{"style":70},[6074],{"type":22,"value":5786},{"type":17,"tag":63,"props":6076,"children":6077},{"style":208},[6078],{"type":22,"value":5902},{"type":17,"tag":63,"props":6080,"children":6081},{"style":70},[6082],{"type":22,"value":674},{"type":17,"tag":63,"props":6084,"children":6085},{"style":70},[6086],{"type":22,"value":891},{"type":17,"tag":63,"props":6088,"children":6089},{"style":70},[6090],{"type":22,"value":865},{"type":17,"tag":63,"props":6092,"children":6093},{"class":65,"line":2004},[6094,6098,6103,6107,6111,6115,6119,6123],{"type":17,"tag":63,"props":6095,"children":6096},{"style":70},[6097],{"type":22,"value":4847},{"type":17,"tag":63,"props":6099,"children":6100},{"style":208},[6101],{"type":22,"value":6102},"disk",{"type":17,"tag":63,"props":6104,"children":6105},{"style":70},[6106],{"type":22,"value":674},{"type":17,"tag":63,"props":6108,"children":6109},{"style":70},[6110],{"type":22,"value":891},{"type":17,"tag":63,"props":6112,"children":6113},{"style":70},[6114],{"type":22,"value":896},{"type":17,"tag":63,"props":6116,"children":6117},{"style":208},[6118],{"type":22,"value":5815},{"type":17,"tag":63,"props":6120,"children":6121},{"style":70},[6122],{"type":22,"value":674},{"type":17,"tag":63,"props":6124,"children":6125},{"style":70},[6126],{"type":22,"value":4823},{"type":17,"tag":63,"props":6128,"children":6129},{"class":65,"line":2013},[6130],{"type":17,"tag":63,"props":6131,"children":6132},{"style":70},[6133],{"type":22,"value":6027},{"type":17,"tag":63,"props":6135,"children":6136},{"class":65,"line":2040},[6137,6141,6146,6150,6154],{"type":17,"tag":63,"props":6138,"children":6139},{"style":70},[6140],{"type":22,"value":5786},{"type":17,"tag":63,"props":6142,"children":6143},{"style":208},[6144],{"type":22,"value":6145},"media",{"type":17,"tag":63,"props":6147,"children":6148},{"style":70},[6149],{"type":22,"value":674},{"type":17,"tag":63,"props":6151,"children":6152},{"style":70},[6153],{"type":22,"value":891},{"type":17,"tag":63,"props":6155,"children":6156},{"style":70},[6157],{"type":22,"value":865},{"type":17,"tag":63,"props":6159,"children":6160},{"class":65,"line":2074},[6161],{"type":17,"tag":63,"props":6162,"children":6163},{"style":102},[6164],{"type":22,"value":6165},"        // ...\n",{"type":17,"tag":63,"props":6167,"children":6168},{"class":65,"line":2082},[6169,6173,6178,6182,6187,6192],{"type":17,"tag":63,"props":6170,"children":6171},{"style":70},[6172],{"type":22,"value":4847},{"type":17,"tag":63,"props":6174,"children":6175},{"style":208},[6176],{"type":22,"value":6177},"path",{"type":17,"tag":63,"props":6179,"children":6180},{"style":70},[6181],{"type":22,"value":674},{"type":17,"tag":63,"props":6183,"children":6184},{"style":70},[6185],{"type":22,"value":6186},"                =>",{"type":17,"tag":63,"props":6188,"children":6189},{"style":70},[6190],{"type":22,"value":6191}," ''",{"type":17,"tag":63,"props":6193,"children":6194},{"style":70},[6195],{"type":22,"value":4823},{"type":17,"tag":63,"props":6197,"children":6198},{"class":65,"line":2091},[6199],{"type":17,"tag":63,"props":6200,"children":6201},{"style":70},[6202],{"type":22,"value":6027},{"type":17,"tag":63,"props":6204,"children":6205},{"class":65,"line":2127},[6206],{"type":17,"tag":63,"props":6207,"children":6208},{"style":70},[6209],{"type":22,"value":1025},{"type":17,"tag":63,"props":6211,"children":6212},{"class":65,"line":2163},[6213],{"type":17,"tag":63,"props":6214,"children":6215},{"emptyLinePlaceholder":1409},[6216],{"type":22,"value":1412},{"type":17,"tag":63,"props":6218,"children":6219},{"class":65,"line":2199},[6220],{"type":17,"tag":63,"props":6221,"children":6222},{"style":102},[6223],{"type":22,"value":6224},"// resources/views/vendor/voyager/master.blade.php\n",{"type":17,"tag":63,"props":6226,"children":6227},{"class":65,"line":2245},[6228,6232,6237,6241,6245,6250,6254,6259,6263,6267,6272,6276],{"type":17,"tag":63,"props":6229,"children":6230},{"style":70},[6231],{"type":22,"value":5374},{"type":17,"tag":63,"props":6233,"children":6234},{"style":76},[6235],{"type":22,"value":6236},"meta name",{"type":17,"tag":63,"props":6238,"children":6239},{"style":70},[6240],{"type":22,"value":84},{"type":17,"tag":63,"props":6242,"children":6243},{"style":70},[6244],{"type":22,"value":205},{"type":17,"tag":63,"props":6246,"children":6247},{"style":208},[6248],{"type":22,"value":6249},"assets-path",{"type":17,"tag":63,"props":6251,"children":6252},{"style":70},[6253],{"type":22,"value":205},{"type":17,"tag":63,"props":6255,"children":6256},{"style":76},[6257],{"type":22,"value":6258}," content",{"type":17,"tag":63,"props":6260,"children":6261},{"style":70},[6262],{"type":22,"value":84},{"type":17,"tag":63,"props":6264,"children":6265},{"style":70},[6266],{"type":22,"value":205},{"type":17,"tag":63,"props":6268,"children":6269},{"style":208},[6270],{"type":22,"value":6271},"{{ route('voyager.voyager_assets') }}",{"type":17,"tag":63,"props":6273,"children":6274},{"style":70},[6275],{"type":22,"value":205},{"type":17,"tag":63,"props":6277,"children":6278},{"style":70},[6279],{"type":22,"value":6280},"/>\n",{"type":17,"tag":63,"props":6282,"children":6283},{"class":65,"line":2253},[6284],{"type":17,"tag":63,"props":6285,"children":6286},{"style":102},[6287],{"type":22,"value":6288},"// ...\n",{"type":17,"tag":63,"props":6290,"children":6291},{"class":65,"line":3973},[6292,6297,6302,6306,6310,6315,6319],{"type":17,"tag":63,"props":6293,"children":6294},{"style":70},[6295],{"type":22,"value":6296},"@",{"type":17,"tag":63,"props":6298,"children":6299},{"style":1418},[6300],{"type":22,"value":6301},"include",{"type":17,"tag":63,"props":6303,"children":6304},{"style":70},[6305],{"type":22,"value":200},{"type":17,"tag":63,"props":6307,"children":6308},{"style":70},[6309],{"type":22,"value":674},{"type":17,"tag":63,"props":6311,"children":6312},{"style":208},[6313],{"type":22,"value":6314},"voyager::media.manager",{"type":17,"tag":63,"props":6316,"children":6317},{"style":70},[6318],{"type":22,"value":674},{"type":17,"tag":63,"props":6320,"children":6321},{"style":70},[6322],{"type":22,"value":347},{"type":17,"tag":5340,"props":6324,"children":6326},{"src":6325},"articles/record-of-upgrading-voyager-version-to-1.2-4.jpg",[],{"type":17,"tag":24,"props":6328,"children":6330},{"id":6329},"_5-套件已自行處理-json_decode",[6331],{"type":22,"value":6332},"5. 套件已自行處理 json_decode",{"type":17,"tag":5340,"props":6334,"children":6336},{"src":6335},"articles/record-of-upgrading-voyager-version-to-1.2-5.jpg",[],{"type":17,"tag":24,"props":6338,"children":6340},{"id":6339},"_6-側邊攔錯誤訊息",[6341],{"type":22,"value":6342},"6. 側邊攔錯誤訊息",{"type":17,"tag":18,"props":6344,"children":6345},{},[6346,6352],{"type":17,"tag":33,"props":6347,"children":6349},{"className":6348},[],[6350],{"type":22,"value":6351},"resources/views/vendor/voyager/dashboard/sidebar.blade.php",{"type":22,"value":6353},"\n原寫法",{"type":17,"tag":53,"props":6355,"children":6357},{"className":55,"code":6356,"language":57,"meta":8,"style":8},"{!! menu('admin', 'admin_menu') !!}\n",[6358],{"type":17,"tag":33,"props":6359,"children":6360},{"__ignoreMap":8},[6361],{"type":17,"tag":63,"props":6362,"children":6363},{"class":65,"line":66},[6364,6369,6374,6378,6382,6387,6391,6395,6399,6404,6408,6412],{"type":17,"tag":63,"props":6365,"children":6366},{"style":70},[6367],{"type":22,"value":6368},"{!!",{"type":17,"tag":63,"props":6370,"children":6371},{"style":87},[6372],{"type":22,"value":6373}," menu",{"type":17,"tag":63,"props":6375,"children":6376},{"style":70},[6377],{"type":22,"value":200},{"type":17,"tag":63,"props":6379,"children":6380},{"style":70},[6381],{"type":22,"value":674},{"type":17,"tag":63,"props":6383,"children":6384},{"style":208},[6385],{"type":22,"value":6386},"admin",{"type":17,"tag":63,"props":6388,"children":6389},{"style":70},[6390],{"type":22,"value":674},{"type":17,"tag":63,"props":6392,"children":6393},{"style":70},[6394],{"type":22,"value":910},{"type":17,"tag":63,"props":6396,"children":6397},{"style":70},[6398],{"type":22,"value":896},{"type":17,"tag":63,"props":6400,"children":6401},{"style":208},[6402],{"type":22,"value":6403},"admin_menu",{"type":17,"tag":63,"props":6405,"children":6406},{"style":70},[6407],{"type":22,"value":674},{"type":17,"tag":63,"props":6409,"children":6410},{"style":70},[6411],{"type":22,"value":553},{"type":17,"tag":63,"props":6413,"children":6414},{"style":70},[6415],{"type":22,"value":6416}," !!}\n",{"type":17,"tag":18,"props":6418,"children":6419},{},[6420],{"type":22,"value":6421},"改為",{"type":17,"tag":53,"props":6423,"children":6425},{"className":55,"code":6424,"language":57,"meta":8,"style":8},"\u003Cdiv id=\"adminmenu\">\n    \u003Cadmin-menu :items=\"{{ menu('admin', '_json') }}\">\u003C/admin-menu>\n\u003C/div>\n",[6426],{"type":17,"tag":33,"props":6427,"children":6428},{"__ignoreMap":8},[6429,6462,6530],{"type":17,"tag":63,"props":6430,"children":6431},{"class":65,"line":66},[6432,6436,6441,6445,6449,6454,6458],{"type":17,"tag":63,"props":6433,"children":6434},{"style":70},[6435],{"type":22,"value":5374},{"type":17,"tag":63,"props":6437,"children":6438},{"style":76},[6439],{"type":22,"value":6440},"div id",{"type":17,"tag":63,"props":6442,"children":6443},{"style":70},[6444],{"type":22,"value":84},{"type":17,"tag":63,"props":6446,"children":6447},{"style":70},[6448],{"type":22,"value":205},{"type":17,"tag":63,"props":6450,"children":6451},{"style":208},[6452],{"type":22,"value":6453},"adminmenu",{"type":17,"tag":63,"props":6455,"children":6456},{"style":70},[6457],{"type":22,"value":205},{"type":17,"tag":63,"props":6459,"children":6460},{"style":70},[6461],{"type":22,"value":5414},{"type":17,"tag":63,"props":6463,"children":6464},{"class":65,"line":98},[6465,6470,6474,6478,6483,6487,6492,6496,6500,6505,6509,6513,6517,6521,6526],{"type":17,"tag":63,"props":6466,"children":6467},{"style":70},[6468],{"type":22,"value":6469},"    \u003C",{"type":17,"tag":63,"props":6471,"children":6472},{"style":76},[6473],{"type":22,"value":6386},{"type":17,"tag":63,"props":6475,"children":6476},{"style":70},[6477],{"type":22,"value":161},{"type":17,"tag":63,"props":6479,"children":6480},{"style":76},[6481],{"type":22,"value":6482},"menu ",{"type":17,"tag":63,"props":6484,"children":6485},{"style":70},[6486],{"type":22,"value":3127},{"type":17,"tag":63,"props":6488,"children":6489},{"style":76},[6490],{"type":22,"value":6491},"items",{"type":17,"tag":63,"props":6493,"children":6494},{"style":70},[6495],{"type":22,"value":84},{"type":17,"tag":63,"props":6497,"children":6498},{"style":70},[6499],{"type":22,"value":205},{"type":17,"tag":63,"props":6501,"children":6502},{"style":208},[6503],{"type":22,"value":6504},"{{ menu('admin', '_json') }}",{"type":17,"tag":63,"props":6506,"children":6507},{"style":70},[6508],{"type":22,"value":205},{"type":17,"tag":63,"props":6510,"children":6511},{"style":70},[6512],{"type":22,"value":5405},{"type":17,"tag":63,"props":6514,"children":6515},{"style":76},[6516],{"type":22,"value":6386},{"type":17,"tag":63,"props":6518,"children":6519},{"style":70},[6520],{"type":22,"value":161},{"type":17,"tag":63,"props":6522,"children":6523},{"style":76},[6524],{"type":22,"value":6525},"menu",{"type":17,"tag":63,"props":6527,"children":6528},{"style":70},[6529],{"type":22,"value":5414},{"type":17,"tag":63,"props":6531,"children":6532},{"class":65,"line":108},[6533,6538,6543],{"type":17,"tag":63,"props":6534,"children":6535},{"style":70},[6536],{"type":22,"value":6537},"\u003C/",{"type":17,"tag":63,"props":6539,"children":6540},{"style":76},[6541],{"type":22,"value":6542},"div",{"type":17,"tag":63,"props":6544,"children":6545},{"style":70},[6546],{"type":22,"value":5414},{"type":17,"tag":5340,"props":6548,"children":6550},{"src":6549},"articles/record-of-upgrading-voyager-version-to-1.2-6.jpg",[],{"type":17,"tag":24,"props":6552,"children":6554},{"id":6553},"_7-已移除-searchable",[6555],{"type":22,"value":6556},"7. 已移除 $searchable",{"type":17,"tag":18,"props":6558,"children":6559},{},[6560,6562,6568,6570],{"type":22,"value":6561},"將 ",{"type":17,"tag":33,"props":6563,"children":6565},{"className":6564},[],[6566],{"type":22,"value":6567},"$searchable",{"type":22,"value":6569}," 改為 ",{"type":17,"tag":33,"props":6571,"children":6573},{"className":6572},[],[6574],{"type":22,"value":6575},"$searchNames",{"type":17,"tag":5340,"props":6577,"children":6579},{"src":6578},"articles/record-of-upgrading-voyager-version-to-1.2-7.jpg",[],{"type":17,"tag":24,"props":6581,"children":6583},{"id":6582},"_8-sortbyurl-參數必填",[6584],{"type":22,"value":6585},"8. sortByUrl() 參數必填",{"type":17,"tag":18,"props":6587,"children":6588},{},[6589,6590,6596,6597],{"type":22,"value":6561},{"type":17,"tag":33,"props":6591,"children":6593},{"className":6592},[],[6594],{"type":22,"value":6595},"{{ $row->sortByUrl() }}",{"type":22,"value":6569},{"type":17,"tag":33,"props":6598,"children":6600},{"className":6599},[],[6601],{"type":22,"value":6602},"{{ $row->sortByUrl($row->field, 'asc') }}",{"type":17,"tag":5340,"props":6604,"children":6606},{"src":6605},"articles/record-of-upgrading-voyager-version-to-1.2-8.jpg",[],{"type":17,"tag":24,"props":6608,"children":6610},{"id":6609},"_9-iscurrentsortfield-參數必填",[6611],{"type":22,"value":6612},"9. isCurrentSortField() 參數必填",{"type":17,"tag":18,"props":6614,"children":6615},{},[6616,6617,6623,6624],{"type":22,"value":6561},{"type":17,"tag":33,"props":6618,"children":6620},{"className":6619},[],[6621],{"type":22,"value":6622},"$row->isCurrentSortField()",{"type":22,"value":6569},{"type":17,"tag":33,"props":6625,"children":6627},{"className":6626},[],[6628],{"type":22,"value":6629},"$row->isCurrentSortField('')",{"type":17,"tag":5340,"props":6631,"children":6633},{"src":6632},"articles/record-of-upgrading-voyager-version-to-1.2-9.jpg",[],{"type":17,"tag":810,"props":6635,"children":6636},{},[6637],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":6639},[6640,6641,6642,6643,6644,6645,6646,6647,6648],{"id":5672,"depth":98,"text":5675},{"id":5716,"depth":98,"text":5719},{"id":5726,"depth":98,"text":5729},{"id":5736,"depth":98,"text":5739},{"id":6329,"depth":98,"text":6332},{"id":6339,"depth":98,"text":6342},{"id":6553,"depth":98,"text":6556},{"id":6582,"depth":98,"text":6585},{"id":6609,"depth":98,"text":6612},"content:article:coding:record-of-upgrading-voyager-version-to-1.2.md","article/coding/record-of-upgrading-voyager-version-to-1.2.md","article/coding/record-of-upgrading-voyager-version-to-1.2",{"_path":6653,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":6654,"description":6655,"category":6,"createdAt":6656,"updatedAt":6656,"body":6657,"_type":821,"_id":6731,"_source":823,"_file":6732,"_stem":6733,"_extension":826},"/article/coding/what-is-google-core-web-vitals","網站體驗核心指標(Core Web Vitals) 是什麼呢","網站體驗核心指標(Core Web Vitals) 包含 Google 最在意的幾個核心的網頁性能指標，像是 LCP、FID、CLS 等，這幾個核心的性能指標對於網站的 SEO 關鍵字排名的影響非常大，也同時反應出使用者的用戶體驗，以下就專門針對這三個指標來說明：","2023-01-04",{"type":14,"children":6658,"toc":6726},[6659,6663,6669,6675,6680,6685,6691,6696,6701,6707,6721],{"type":17,"tag":18,"props":6660,"children":6661},{},[6662],{"type":22,"value":6655},{"type":17,"tag":5340,"props":6664,"children":6668},{"src":6665,"name":6666,"origin-link":6667},"articles/what-is-google-core-web-vitals-1.png","Core Web Vitals","https://web.dev/vitals/",[],{"type":17,"tag":24,"props":6670,"children":6672},{"id":6671},"最大內容繪製-lcp-largest-contentful-paint",[6673],{"type":22,"value":6674},"最大內容繪製 LCP (Largest Contentful Paint)",{"type":17,"tag":18,"props":6676,"children":6677},{},[6678],{"type":22,"value":6679},"在使用者打開網頁的第一個畫面所顯示「最大元素」所需的載入時間，可反應網站的速度。最佳為 2.5 秒以內。",{"type":17,"tag":18,"props":6681,"children":6682},{},[6683],{"type":22,"value":6684},"優化方式: 減少伺服器的反應時間、優化網頁資源(ex: image、JavaScript、CSS) 的載入狀況與時間。",{"type":17,"tag":24,"props":6686,"children":6688},{"id":6687},"首次輸入延遲-fid-first-input-delay",[6689],{"type":22,"value":6690},"首次輸入延遲 FID (First Input Delay)",{"type":17,"tag":18,"props":6692,"children":6693},{},[6694],{"type":22,"value":6695},"在使用者第一次對網站的物件互動時，網站花了多少時間去產生相對應的反應時間，而這個互動是僅算「單次互動」例如點擊...等。最佳為 100毫秒(0.1秒)以內。",{"type":17,"tag":18,"props":6697,"children":6698},{},[6699],{"type":22,"value":6700},"優化方式: 減少網站載入一些未使用的資源、能用 CSS 就用來減少 Javascript 執行時間。",{"type":17,"tag":24,"props":6702,"children":6704},{"id":6703},"累計版面配置轉移-cls-cumulative-layout-shift",[6705],{"type":22,"value":6706},"累計版面配置轉移 CLS (Cumulative Layout Shift)",{"type":17,"tag":18,"props":6708,"children":6709},{},[6710,6712,6719],{"type":22,"value":6711},"當使用者想要點擊網頁上的某物件時，可能會因為網站加載未完成而導致版面發生位移，使用者就點不到預期的物件，使用者體驗就很糟糕。最佳分數為 0.1 以內。至於這個分數是怎麼計算的就參考",{"type":17,"tag":2386,"props":6713,"children":6716},{"href":6714,"rel":6715,"target":2391},"https://web.dev/i18n/en/cls/",[2390],[6717],{"type":22,"value":6718},"官方文件",{"type":22,"value":6720},"。",{"type":17,"tag":18,"props":6722,"children":6723},{},[6724],{"type":22,"value":6725},"優化方式: 可先設定外部嵌入資源尺寸、需載入時間的元素先設定尺寸固定。",{"title":8,"searchDepth":98,"depth":98,"links":6727},[6728,6729,6730],{"id":6671,"depth":98,"text":6674},{"id":6687,"depth":98,"text":6690},{"id":6703,"depth":98,"text":6706},"content:article:coding:what-is-google-core-web-vitals.md","article/coding/what-is-google-core-web-vitals.md","article/coding/what-is-google-core-web-vitals",{"_path":6735,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":6736,"description":6737,"category":6,"createdAt":6738,"updatedAt":6738,"body":6739,"_type":821,"_id":6947,"_source":823,"_file":6948,"_stem":6949,"_extension":826},"/article/coding/post-xml-data-to-php-laravel","PHP Laravel 讀取 XML 格式資料","這邊紀錄一下如何用 PHP Laravel 讀取一串 XML 格式的資料，如下圖所示:","2022-12-07",{"type":14,"children":6740,"toc":6945},[6741,6745,6749,6770,6936,6941],{"type":17,"tag":18,"props":6742,"children":6743},{},[6744],{"type":22,"value":6737},{"type":17,"tag":5340,"props":6746,"children":6748},{"src":6747},"articles/post_xml_data_to_php_laravel-1.jpg",[],{"type":17,"tag":18,"props":6750,"children":6751},{},[6752,6754,6760,6762,6768],{"type":22,"value":6753},"在 ",{"type":17,"tag":33,"props":6755,"children":6757},{"className":6756},[],[6758],{"type":22,"value":6759},"Body",{"type":22,"value":6761}," 中選擇 ",{"type":17,"tag":33,"props":6763,"children":6765},{"className":6764},[],[6766],{"type":22,"value":6767},"XML",{"type":22,"value":6769}," 格式後，內容貼上 XML 格式的資料，最後 PHP 語法如下:",{"type":17,"tag":53,"props":6771,"children":6773},{"className":55,"code":6772,"language":57,"meta":8,"style":8},"public function getXml(Request $request)\n{\n    $data = simplexml_load_string($request->getContent());\n    $data = json_decode(json_encode($data), true);\n    dd($data);\n}\n",[6774],{"type":17,"tag":33,"props":6775,"children":6776},{"__ignoreMap":8},[6777,6814,6821,6863,6909,6929],{"type":17,"tag":63,"props":6778,"children":6779},{"class":65,"line":66},[6780,6784,6788,6793,6797,6802,6806,6810],{"type":17,"tag":63,"props":6781,"children":6782},{"style":2296},[6783],{"type":22,"value":2413},{"type":17,"tag":63,"props":6785,"children":6786},{"style":2296},[6787],{"type":22,"value":2418},{"type":17,"tag":63,"props":6789,"children":6790},{"style":87},[6791],{"type":22,"value":6792}," getXml",{"type":17,"tag":63,"props":6794,"children":6795},{"style":70},[6796],{"type":22,"value":200},{"type":17,"tag":63,"props":6798,"children":6799},{"style":182},[6800],{"type":22,"value":6801},"Request",{"type":17,"tag":63,"props":6803,"children":6804},{"style":70},[6805],{"type":22,"value":152},{"type":17,"tag":63,"props":6807,"children":6808},{"style":76},[6809],{"type":22,"value":2441},{"type":17,"tag":63,"props":6811,"children":6812},{"style":70},[6813],{"type":22,"value":347},{"type":17,"tag":63,"props":6815,"children":6816},{"class":65,"line":98},[6817],{"type":17,"tag":63,"props":6818,"children":6819},{"style":70},[6820],{"type":22,"value":2453},{"type":17,"tag":63,"props":6822,"children":6823},{"class":65,"line":108},[6824,6828,6832,6836,6841,6845,6849,6853,6858],{"type":17,"tag":63,"props":6825,"children":6826},{"style":70},[6827],{"type":22,"value":1460},{"type":17,"tag":63,"props":6829,"children":6830},{"style":76},[6831],{"type":22,"value":2682},{"type":17,"tag":63,"props":6833,"children":6834},{"style":70},[6835],{"type":22,"value":84},{"type":17,"tag":63,"props":6837,"children":6838},{"style":87},[6839],{"type":22,"value":6840}," simplexml_load_string",{"type":17,"tag":63,"props":6842,"children":6843},{"style":70},[6844],{"type":22,"value":337},{"type":17,"tag":63,"props":6846,"children":6847},{"style":76},[6848],{"type":22,"value":2441},{"type":17,"tag":63,"props":6850,"children":6851},{"style":70},[6852],{"type":22,"value":1774},{"type":17,"tag":63,"props":6854,"children":6855},{"style":87},[6856],{"type":22,"value":6857},"getContent",{"type":17,"tag":63,"props":6859,"children":6860},{"style":70},[6861],{"type":22,"value":6862},"());\n",{"type":17,"tag":63,"props":6864,"children":6865},{"class":65,"line":133},[6866,6870,6874,6878,6883,6887,6892,6896,6900,6904],{"type":17,"tag":63,"props":6867,"children":6868},{"style":70},[6869],{"type":22,"value":1460},{"type":17,"tag":63,"props":6871,"children":6872},{"style":76},[6873],{"type":22,"value":2682},{"type":17,"tag":63,"props":6875,"children":6876},{"style":70},[6877],{"type":22,"value":84},{"type":17,"tag":63,"props":6879,"children":6880},{"style":87},[6881],{"type":22,"value":6882}," json_decode",{"type":17,"tag":63,"props":6884,"children":6885},{"style":70},[6886],{"type":22,"value":200},{"type":17,"tag":63,"props":6888,"children":6889},{"style":87},[6890],{"type":22,"value":6891},"json_encode",{"type":17,"tag":63,"props":6893,"children":6894},{"style":70},[6895],{"type":22,"value":337},{"type":17,"tag":63,"props":6897,"children":6898},{"style":76},[6899],{"type":22,"value":3052},{"type":17,"tag":63,"props":6901,"children":6902},{"style":70},[6903],{"type":22,"value":2330},{"type":17,"tag":63,"props":6905,"children":6906},{"style":70},[6907],{"type":22,"value":6908}," true);\n",{"type":17,"tag":63,"props":6910,"children":6911},{"class":65,"line":178},[6912,6917,6921,6925],{"type":17,"tag":63,"props":6913,"children":6914},{"style":87},[6915],{"type":22,"value":6916},"    dd",{"type":17,"tag":63,"props":6918,"children":6919},{"style":70},[6920],{"type":22,"value":337},{"type":17,"tag":63,"props":6922,"children":6923},{"style":76},[6924],{"type":22,"value":3052},{"type":17,"tag":63,"props":6926,"children":6927},{"style":70},[6928],{"type":22,"value":229},{"type":17,"tag":63,"props":6930,"children":6931},{"class":65,"line":474},[6932],{"type":17,"tag":63,"props":6933,"children":6934},{"style":70},[6935],{"type":22,"value":2088},{"type":17,"tag":18,"props":6937,"children":6938},{},[6939],{"type":22,"value":6940},"即可拿到 array 的格式資料。",{"type":17,"tag":810,"props":6942,"children":6943},{},[6944],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":6946},[],"content:article:coding:post-xml-data-to-php-laravel.md","article/coding/post-xml-data-to-php-laravel.md","article/coding/post-xml-data-to-php-laravel",{"_path":6951,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":6952,"description":6953,"category":6,"createdAt":6954,"updatedAt":6954,"body":6955,"_type":821,"_id":7242,"_source":823,"_file":7243,"_stem":7244,"_extension":826},"/article/coding/create-pdf-and-browser-print-page-break","程式匯出成 PDF 和瀏覽器列印設定換頁","最近有個需求是用程式產出內容有兩大區塊的 PDF，試了使用的程式套件一陣子後發現不是在套件做設定，而是直接在 css 上調整就可以了，像是這樣:","2022-09-26",{"type":14,"children":6956,"toc":7240},[6957,6961,7223,7236],{"type":17,"tag":18,"props":6958,"children":6959},{},[6960],{"type":22,"value":6953},{"type":17,"tag":53,"props":6962,"children":6964},{"className":5360,"code":6963,"language":5362,"meta":8,"style":8},"\u003Chead>\n    \u003Cstyle>\n    .container {\n        page-break-before: always;\n    }\n    \u003C/style>\n\u003C/head>\n\u003Cbody>\n    \u003Cdiv class=\"container\">\n        Block A ...\n    \u003C/div>\n    \u003Cdiv class=\"container\">\n        Block B ...\n    \u003C/div>\n\u003C/body>\n",[6965],{"type":17,"tag":33,"props":6966,"children":6967},{"__ignoreMap":8},[6968,6984,6999,7016,7038,7045,7061,7076,7092,7127,7135,7150,7185,7193,7208],{"type":17,"tag":63,"props":6969,"children":6970},{"class":65,"line":66},[6971,6975,6980],{"type":17,"tag":63,"props":6972,"children":6973},{"style":70},[6974],{"type":22,"value":5374},{"type":17,"tag":63,"props":6976,"children":6977},{"style":4773},[6978],{"type":22,"value":6979},"head",{"type":17,"tag":63,"props":6981,"children":6982},{"style":70},[6983],{"type":22,"value":5414},{"type":17,"tag":63,"props":6985,"children":6986},{"class":65,"line":98},[6987,6991,6995],{"type":17,"tag":63,"props":6988,"children":6989},{"style":70},[6990],{"type":22,"value":6469},{"type":17,"tag":63,"props":6992,"children":6993},{"style":4773},[6994],{"type":22,"value":810},{"type":17,"tag":63,"props":6996,"children":6997},{"style":70},[6998],{"type":22,"value":5414},{"type":17,"tag":63,"props":7000,"children":7001},{"class":65,"line":108},[7002,7007,7012],{"type":17,"tag":63,"props":7003,"children":7004},{"style":70},[7005],{"type":22,"value":7006},"    .",{"type":17,"tag":63,"props":7008,"children":7009},{"style":182},[7010],{"type":22,"value":7011},"container",{"type":17,"tag":63,"props":7013,"children":7014},{"style":70},[7015],{"type":22,"value":1452},{"type":17,"tag":63,"props":7017,"children":7018},{"class":65,"line":133},[7019,7025,7029,7034],{"type":17,"tag":63,"props":7020,"children":7022},{"style":7021},"--shiki-default:#B2CCD6",[7023],{"type":22,"value":7024},"        page-break-before",{"type":17,"tag":63,"props":7026,"children":7027},{"style":70},[7028],{"type":22,"value":3127},{"type":17,"tag":63,"props":7030,"children":7031},{"style":76},[7032],{"type":22,"value":7033}," always",{"type":17,"tag":63,"props":7035,"children":7036},{"style":70},[7037],{"type":22,"value":175},{"type":17,"tag":63,"props":7039,"children":7040},{"class":65,"line":178},[7041],{"type":17,"tag":63,"props":7042,"children":7043},{"style":70},[7044],{"type":22,"value":2010},{"type":17,"tag":63,"props":7046,"children":7047},{"class":65,"line":474},[7048,7053,7057],{"type":17,"tag":63,"props":7049,"children":7050},{"style":70},[7051],{"type":22,"value":7052},"    \u003C/",{"type":17,"tag":63,"props":7054,"children":7055},{"style":4773},[7056],{"type":22,"value":810},{"type":17,"tag":63,"props":7058,"children":7059},{"style":70},[7060],{"type":22,"value":5414},{"type":17,"tag":63,"props":7062,"children":7063},{"class":65,"line":499},[7064,7068,7072],{"type":17,"tag":63,"props":7065,"children":7066},{"style":70},[7067],{"type":22,"value":6537},{"type":17,"tag":63,"props":7069,"children":7070},{"style":4773},[7071],{"type":22,"value":6979},{"type":17,"tag":63,"props":7073,"children":7074},{"style":70},[7075],{"type":22,"value":5414},{"type":17,"tag":63,"props":7077,"children":7078},{"class":65,"line":584},[7079,7083,7088],{"type":17,"tag":63,"props":7080,"children":7081},{"style":70},[7082],{"type":22,"value":5374},{"type":17,"tag":63,"props":7084,"children":7085},{"style":4773},[7086],{"type":22,"value":7087},"body",{"type":17,"tag":63,"props":7089,"children":7090},{"style":70},[7091],{"type":22,"value":5414},{"type":17,"tag":63,"props":7093,"children":7094},{"class":65,"line":731},[7095,7099,7103,7107,7111,7115,7119,7123],{"type":17,"tag":63,"props":7096,"children":7097},{"style":70},[7098],{"type":22,"value":6469},{"type":17,"tag":63,"props":7100,"children":7101},{"style":4773},[7102],{"type":22,"value":6542},{"type":17,"tag":63,"props":7104,"children":7105},{"style":2296},[7106],{"type":22,"value":3619},{"type":17,"tag":63,"props":7108,"children":7109},{"style":70},[7110],{"type":22,"value":84},{"type":17,"tag":63,"props":7112,"children":7113},{"style":70},[7114],{"type":22,"value":205},{"type":17,"tag":63,"props":7116,"children":7117},{"style":208},[7118],{"type":22,"value":7011},{"type":17,"tag":63,"props":7120,"children":7121},{"style":70},[7122],{"type":22,"value":205},{"type":17,"tag":63,"props":7124,"children":7125},{"style":70},[7126],{"type":22,"value":5414},{"type":17,"tag":63,"props":7128,"children":7129},{"class":65,"line":1754},[7130],{"type":17,"tag":63,"props":7131,"children":7132},{"style":76},[7133],{"type":22,"value":7134},"        Block A ...\n",{"type":17,"tag":63,"props":7136,"children":7137},{"class":65,"line":1799},[7138,7142,7146],{"type":17,"tag":63,"props":7139,"children":7140},{"style":70},[7141],{"type":22,"value":7052},{"type":17,"tag":63,"props":7143,"children":7144},{"style":4773},[7145],{"type":22,"value":6542},{"type":17,"tag":63,"props":7147,"children":7148},{"style":70},[7149],{"type":22,"value":5414},{"type":17,"tag":63,"props":7151,"children":7152},{"class":65,"line":1849},[7153,7157,7161,7165,7169,7173,7177,7181],{"type":17,"tag":63,"props":7154,"children":7155},{"style":70},[7156],{"type":22,"value":6469},{"type":17,"tag":63,"props":7158,"children":7159},{"style":4773},[7160],{"type":22,"value":6542},{"type":17,"tag":63,"props":7162,"children":7163},{"style":2296},[7164],{"type":22,"value":3619},{"type":17,"tag":63,"props":7166,"children":7167},{"style":70},[7168],{"type":22,"value":84},{"type":17,"tag":63,"props":7170,"children":7171},{"style":70},[7172],{"type":22,"value":205},{"type":17,"tag":63,"props":7174,"children":7175},{"style":208},[7176],{"type":22,"value":7011},{"type":17,"tag":63,"props":7178,"children":7179},{"style":70},[7180],{"type":22,"value":205},{"type":17,"tag":63,"props":7182,"children":7183},{"style":70},[7184],{"type":22,"value":5414},{"type":17,"tag":63,"props":7186,"children":7187},{"class":65,"line":1901},[7188],{"type":17,"tag":63,"props":7189,"children":7190},{"style":76},[7191],{"type":22,"value":7192},"        Block B ...\n",{"type":17,"tag":63,"props":7194,"children":7195},{"class":65,"line":1952},[7196,7200,7204],{"type":17,"tag":63,"props":7197,"children":7198},{"style":70},[7199],{"type":22,"value":7052},{"type":17,"tag":63,"props":7201,"children":7202},{"style":4773},[7203],{"type":22,"value":6542},{"type":17,"tag":63,"props":7205,"children":7206},{"style":70},[7207],{"type":22,"value":5414},{"type":17,"tag":63,"props":7209,"children":7210},{"class":65,"line":1961},[7211,7215,7219],{"type":17,"tag":63,"props":7212,"children":7213},{"style":70},[7214],{"type":22,"value":6537},{"type":17,"tag":63,"props":7216,"children":7217},{"style":4773},[7218],{"type":22,"value":7087},{"type":17,"tag":63,"props":7220,"children":7221},{"style":70},[7222],{"type":22,"value":5414},{"type":17,"tag":18,"props":7224,"children":7225},{},[7226,7228,7234],{"type":22,"value":7227},"透過設定 ",{"type":17,"tag":33,"props":7229,"children":7231},{"className":7230},[],[7232],{"type":22,"value":7233},"page-break-before: always;",{"type":22,"value":7235}," 讓此 DOM 元素之前強制換頁， 即可看到第二個區塊 Block B 的內容在匯出的 PDF 內的下一頁開頭印出，而在瀏覽器列印也是可以使用此 css 來設定下一個區塊換頁!",{"type":17,"tag":810,"props":7237,"children":7238},{},[7239],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":7241},[],"content:article:coding:create-pdf-and-browser-print-page-break.md","article/coding/create-pdf-and-browser-print-page-break.md","article/coding/create-pdf-and-browser-print-page-break",{"_path":7246,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":7247,"description":7248,"category":6,"createdAt":7249,"updatedAt":7249,"body":7250,"_type":821,"_id":7278,"_source":823,"_file":7279,"_stem":7280,"_extension":826},"/article/coding/php-fpm-nginx-roadrunner-swoole-speed-test","PHP-FPM 搭配 Nginx vs Roadrunner vs Swoole 速度實驗","這次實驗是出於好奇心，想要比較看看 PHP-FPM 搭配 Nginx 和 Roadrunner 和 Swoole 在相同的程式碼、執行環境下，速度的表現是如何。這邊使用 serialize() 序列化作測試函數一百萬次，然後三種架設的最大連接數都設為 3000，Request 數量分別使用 1、20、100、1000、4000 次去做測試，看下圖:","2022-09-04",{"type":14,"children":7251,"toc":7275},[7252,7256,7260,7265,7270],{"type":17,"tag":18,"props":7253,"children":7254},{},[7255],{"type":22,"value":7248},{"type":17,"tag":5340,"props":7257,"children":7259},{"src":7258},"articles/php-fpm-nginx-roadrunner-swoole-speed-test-1.png",[],{"type":17,"tag":18,"props":7261,"children":7262},{},[7263],{"type":22,"value":7264},"我在 Roadrunner 和 Swoole 環境下都分別使用 1、2、8 workers 去執行，如上圖可以發現，在 Request 數少的時候，執行速度由 PHP-FPM 搭配 Nginx 和 Swoole 環境下最快，而且 Request 數越來越多且 workers 開啟的數量適當時，Swoole 能夠 100% 且快速的回應大量的成功 Response，這效能真猛阿！",{"type":17,"tag":24,"props":7266,"children":7268},{"id":7267},"結語",[7269],{"type":22,"value":7267},{"type":17,"tag":18,"props":7271,"children":7272},{},[7273],{"type":22,"value":7274},"Roadrunner 在我本次測驗的成果並沒有我預期的這麼好，不確定是不是我的測試環境影響。總之，這次實驗我對 Swoole 相當滿意，我自己是如果之後有機會碰到有高併發需求的專案，就會優先使用 Swoole 來架設啦！",{"title":8,"searchDepth":98,"depth":98,"links":7276},[7277],{"id":7267,"depth":98,"text":7267},"content:article:coding:php-fpm-nginx-roadrunner-swoole-speed-test.md","article/coding/php-fpm-nginx-roadrunner-swoole-speed-test.md","article/coding/php-fpm-nginx-roadrunner-swoole-speed-test",{"_path":7282,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":7283,"description":7284,"category":6,"createdAt":7285,"updatedAt":7285,"body":7286,"_type":821,"_id":7518,"_source":823,"_file":7519,"_stem":7520,"_extension":826},"/article/coding/php-laravel-swoole-first-experience","PHP Laravel + Swoole 初體驗","繼上次的 PHP Laravel + RoadRunner 初體驗 初次玩了 RoadRunner 的架設之後，今天就來體驗一下號稱高性能、加快速度的 Swoole 吧!","2022-09-01",{"type":14,"children":7287,"toc":7511},[7288,7302,7307,7416,7421,7440,7453,7461,7466,7479,7484,7489,7493,7498,7502,7507],{"type":17,"tag":18,"props":7289,"children":7290},{},[7291,7293,7300],{"type":22,"value":7292},"繼上次的 ",{"type":17,"tag":2386,"props":7294,"children":7297},{"href":7295,"rel":7296},"https://wangchristine.github.io/article/coding/php-laravel-roadrunner-first-experience",[2390],[7298],{"type":22,"value":7299},"PHP Laravel + RoadRunner 初體驗",{"type":22,"value":7301}," 初次玩了 RoadRunner 的架設之後，今天就來體驗一下號稱高性能、加快速度的 Swoole 吧!",{"type":17,"tag":24,"props":7303,"children":7305},{"id":7304},"環境",[7306],{"type":22,"value":7304},{"type":17,"tag":5485,"props":7308,"children":7309},{},[7310,7345],{"type":17,"tag":2640,"props":7311,"children":7312},{},[7313,7315,7321,7323],{"type":22,"value":7314},"Docker: 主要使用 Swoole 官方提供的 image，PHP 擴充記得安裝 ",{"type":17,"tag":33,"props":7316,"children":7318},{"className":7317},[],[7319],{"type":22,"value":7320},"sockets",{"type":22,"value":7322},"，其他像是 PHP 的 image 版本和相關執行指令看個人專案去安裝。\n",{"type":17,"tag":53,"props":7324,"children":7328},{"code":7325,"language":7326,"meta":8,"className":7327,"style":8},"FROM phpswoole/swoole:php8.0-alpine\n","dockerfile","language-dockerfile shiki shiki-themes material-theme-palenight",[7329],{"type":17,"tag":33,"props":7330,"children":7331},{"__ignoreMap":8},[7332],{"type":17,"tag":63,"props":7333,"children":7334},{"class":65,"line":66},[7335,7340],{"type":17,"tag":63,"props":7336,"children":7337},{"style":561},[7338],{"type":22,"value":7339},"FROM",{"type":17,"tag":63,"props":7341,"children":7342},{"style":76},[7343],{"type":22,"value":7344}," phpswoole/swoole:php8.0-alpine\n",{"type":17,"tag":2640,"props":7346,"children":7347},{},[7348,7350,7385],{"type":22,"value":7349},"Laravel\n",{"type":17,"tag":2636,"props":7351,"children":7352},{},[7353,7364],{"type":17,"tag":2640,"props":7354,"children":7355},{},[7356,7358],{"type":22,"value":7357},"Composer 裝這個: ",{"type":17,"tag":33,"props":7359,"children":7361},{"className":7360},[],[7362],{"type":22,"value":7363},"swooletw/laravel-swoole",{"type":17,"tag":2640,"props":7365,"children":7366},{},[7367,7369,7375,7377,7383],{"type":22,"value":7368},"產生套件設定檔(",{"type":17,"tag":33,"props":7370,"children":7372},{"className":7371},[],[7373],{"type":22,"value":7374},"swoole_http.php",{"type":22,"value":7376}," and ",{"type":17,"tag":33,"props":7378,"children":7380},{"className":7379},[],[7381],{"type":22,"value":7382},"swoole_websocket.php",{"type":22,"value":7384},"):",{"type":17,"tag":53,"props":7386,"children":7390},{"code":7387,"language":7388,"meta":8,"className":7389,"style":8},"php artisan vendor:publish --tag=laravel-swoole\n","sh","language-sh shiki shiki-themes material-theme-palenight",[7391],{"type":17,"tag":33,"props":7392,"children":7393},{"__ignoreMap":8},[7394],{"type":17,"tag":63,"props":7395,"children":7396},{"class":65,"line":66},[7397,7401,7406,7411],{"type":17,"tag":63,"props":7398,"children":7399},{"style":182},[7400],{"type":22,"value":57},{"type":17,"tag":63,"props":7402,"children":7403},{"style":208},[7404],{"type":22,"value":7405}," artisan",{"type":17,"tag":63,"props":7407,"children":7408},{"style":208},[7409],{"type":22,"value":7410}," vendor:publish",{"type":17,"tag":63,"props":7412,"children":7413},{"style":208},[7414],{"type":22,"value":7415}," --tag=laravel-swoole\n",{"type":17,"tag":24,"props":7417,"children":7419},{"id":7418},"設定",[7420],{"type":22,"value":7418},{"type":17,"tag":18,"props":7422,"children":7423},{},[7424,7426,7431,7433,7439],{"type":22,"value":7425},"這次我們主要先玩 ",{"type":17,"tag":33,"props":7427,"children":7429},{"className":7428},[],[7430],{"type":22,"value":7374},{"type":22,"value":7432}," 設定檔，可以看到這設定檔滿滿的註解，很貼心的跟我們說每一行主要的用途，想了解細部的解釋可以看",{"type":17,"tag":2386,"props":7434,"children":7437},{"href":7435,"rel":7436,"target":2391},"https://github.com/swooletw/laravel-swoole/wiki/5.-Configuration",[2390],[7438],{"type":22,"value":6718},{"type":22,"value":6720},{"type":17,"tag":18,"props":7441,"children":7442},{},[7443,7445,7451],{"type":22,"value":7444},"基本上到這邊就設定完畢了，但因為我要測試所以在 ",{"type":17,"tag":33,"props":7446,"children":7448},{"className":7447},[],[7449],{"type":22,"value":7450},".env",{"type":22,"value":7452}," 做覆蓋設定:",{"type":17,"tag":53,"props":7454,"children":7456},{"code":7455},"SWOOLE_HTTP_HOST=0.0.0.0\nSWOOLE_HTTP_REACTOR_NUM=1\nSWOOLE_HTTP_WORKER_NUM=1\nSWOOLE_HOT_RELOAD_ENABLE=true\nSWOOLE_OB_OUTPUT=false\n",[7457],{"type":17,"tag":33,"props":7458,"children":7459},{"__ignoreMap":8},[7460],{"type":22,"value":7455},{"type":17,"tag":24,"props":7462,"children":7464},{"id":7463},"執行",[7465],{"type":22,"value":7463},{"type":17,"tag":18,"props":7467,"children":7468},{},[7469,7471,7477],{"type":22,"value":7470},"執行 ",{"type":17,"tag":33,"props":7472,"children":7474},{"className":7473},[],[7475],{"type":22,"value":7476},"php artisan swoole:http start",{"type":22,"value":7478}," 就可以啟動專案囉！",{"type":17,"tag":24,"props":7480,"children":7482},{"id":7481},"小測試",[7483],{"type":22,"value":7481},{"type":17,"tag":18,"props":7485,"children":7486},{},[7487],{"type":22,"value":7488},"使用 serialize() 序列化作測試函數，分別用 FPM 和 Swoole 各做一百萬和五百萬次的測試，如下圖所示，Request 也分別用 1 和 3 來測試執行的時間：",{"type":17,"tag":5340,"props":7490,"children":7492},{"src":7491},"articles/php-laravel-swoole-first-experience-1.png",[],{"type":17,"tag":18,"props":7494,"children":7495},{},[7496],{"type":22,"value":7497},"看到沒有! 由上圖資訊完全可以看出差異，不管是在 Request 數為 1 或 3 時，表現都比 FPM 速度來的優異，快了好幾倍! 可見 Swoole 的速度真的不是浪得虛名。這邊測試的環境皆為 1 CPU，兩者的 work_processes 皆為 1。",{"type":17,"tag":24,"props":7499,"children":7500},{"id":7267},[7501],{"type":22,"value":7267},{"type":17,"tag":18,"props":7503,"children":7504},{},[7505],{"type":22,"value":7506},"這次體驗 Swoole 的速度真的讓我大吃一驚，差點覺得是不是設定改錯了(笑)。雖然這次實驗 Swoole 是直接當它為 Http Server，不過它並不能完全取代 Nginx，畢竟 Swoole 能夠大大提升 PHP 的速度，但 Nginx 能夠更優異的處理靜態檔案等，兩者搭配起來才能各自發揮優勢，下次有空再找時間玩看看兩者搭配的效能如何好了XD",{"type":17,"tag":810,"props":7508,"children":7509},{},[7510],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":7512},[7513,7514,7515,7516,7517],{"id":7304,"depth":98,"text":7304},{"id":7418,"depth":98,"text":7418},{"id":7463,"depth":98,"text":7463},{"id":7481,"depth":98,"text":7481},{"id":7267,"depth":98,"text":7267},"content:article:coding:php-laravel-swoole-first-experience.md","article/coding/php-laravel-swoole-first-experience.md","article/coding/php-laravel-swoole-first-experience",{"_path":7522,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":7299,"description":7523,"category":6,"createdAt":7524,"updatedAt":7525,"body":7526,"_type":821,"_id":8874,"_source":823,"_file":8875,"_stem":8876,"_extension":826},"/article/coding/php-laravel-roadrunner-first-experience","最近準備接手一個用 RoadRunner 架設的專案，之前沒接觸過這工具，在接專案前就先自己架設一個新專案體驗看看吧！","2022-08-20","2022-08-22",{"type":14,"children":7527,"toc":8866},[7528,7532,7536,7708,7712,7725,7738,8337,8357,8777,8781,8793,8797,8810,8814,8819,8823,8828,8833,8862],{"type":17,"tag":18,"props":7529,"children":7530},{},[7531],{"type":22,"value":7523},{"type":17,"tag":24,"props":7533,"children":7534},{"id":7304},[7535],{"type":22,"value":7304},{"type":17,"tag":5485,"props":7537,"children":7538},{},[7539,7605,7631],{"type":17,"tag":2640,"props":7540,"children":7541},{},[7542,7544],{"type":22,"value":7543},"Docker: 主要要引入 RoadRunner 執行指令，PHP 的 image 版本和相關執行指令看個人專案去安裝。",{"type":17,"tag":53,"props":7545,"children":7547},{"className":7327,"code":7546,"language":7326,"meta":8,"style":8},"FROM ghcr.io/roadrunner-server/roadrunner:latest AS roadrunner\nFROM php:8.1-cli\n\nCOPY --from=roadrunner /usr/bin/rr /usr/local/bin/rr\n",[7548],{"type":17,"tag":33,"props":7549,"children":7550},{"__ignoreMap":8},[7551,7573,7585,7592],{"type":17,"tag":63,"props":7552,"children":7553},{"class":65,"line":66},[7554,7558,7563,7568],{"type":17,"tag":63,"props":7555,"children":7556},{"style":561},[7557],{"type":22,"value":7339},{"type":17,"tag":63,"props":7559,"children":7560},{"style":76},[7561],{"type":22,"value":7562}," ghcr.io/roadrunner-server/roadrunner:latest ",{"type":17,"tag":63,"props":7564,"children":7565},{"style":561},[7566],{"type":22,"value":7567},"AS",{"type":17,"tag":63,"props":7569,"children":7570},{"style":76},[7571],{"type":22,"value":7572}," roadrunner\n",{"type":17,"tag":63,"props":7574,"children":7575},{"class":65,"line":98},[7576,7580],{"type":17,"tag":63,"props":7577,"children":7578},{"style":561},[7579],{"type":22,"value":7339},{"type":17,"tag":63,"props":7581,"children":7582},{"style":76},[7583],{"type":22,"value":7584}," php:8.1-cli\n",{"type":17,"tag":63,"props":7586,"children":7587},{"class":65,"line":108},[7588],{"type":17,"tag":63,"props":7589,"children":7590},{"emptyLinePlaceholder":1409},[7591],{"type":22,"value":1412},{"type":17,"tag":63,"props":7593,"children":7594},{"class":65,"line":133},[7595,7600],{"type":17,"tag":63,"props":7596,"children":7597},{"style":561},[7598],{"type":22,"value":7599},"COPY",{"type":17,"tag":63,"props":7601,"children":7602},{"style":76},[7603],{"type":22,"value":7604}," --from=roadrunner /usr/bin/rr /usr/local/bin/rr\n",{"type":17,"tag":2640,"props":7606,"children":7607},{},[7608,7610],{"type":22,"value":7609},"PHP",{"type":17,"tag":2636,"props":7611,"children":7612},{},[7613],{"type":17,"tag":2640,"props":7614,"children":7615},{},[7616,7618,7624,7625],{"type":22,"value":7617},"Composer 裝這兩個:\n",{"type":17,"tag":33,"props":7619,"children":7621},{"className":7620},[],[7622],{"type":22,"value":7623},"nyholm/psr7",{"type":22,"value":5688},{"type":17,"tag":33,"props":7626,"children":7628},{"className":7627},[],[7629],{"type":22,"value":7630},"spiral/roadrunner",{"type":17,"tag":2640,"props":7632,"children":7633},{},[7634,7636],{"type":22,"value":7635},"Laravel",{"type":17,"tag":2636,"props":7637,"children":7638},{},[7639,7655],{"type":17,"tag":2640,"props":7640,"children":7641},{},[7642,7643,7648,7649],{"type":22,"value":7617},{"type":17,"tag":33,"props":7644,"children":7646},{"className":7645},[],[7647],{"type":22,"value":7630},{"type":22,"value":5688},{"type":17,"tag":33,"props":7650,"children":7652},{"className":7651},[],[7653],{"type":22,"value":7654},"spiral/roadrunner-laravel",{"type":17,"tag":2640,"props":7656,"children":7657},{},[7658,7660],{"type":22,"value":7659},"產生套件設定檔:\n",{"type":17,"tag":53,"props":7661,"children":7665},{"className":7662,"code":7663,"language":7664,"meta":8,"style":8},"language-shell shiki shiki-themes material-theme-palenight","php ./artisan vendor:publish --provider='Spiral\\RoadRunnerLaravel\\ServiceProvider' --tag=config\n","shell",[7666],{"type":17,"tag":33,"props":7667,"children":7668},{"__ignoreMap":8},[7669],{"type":17,"tag":63,"props":7670,"children":7671},{"class":65,"line":66},[7672,7676,7681,7685,7690,7694,7699,7703],{"type":17,"tag":63,"props":7673,"children":7674},{"style":182},[7675],{"type":22,"value":57},{"type":17,"tag":63,"props":7677,"children":7678},{"style":208},[7679],{"type":22,"value":7680}," ./artisan",{"type":17,"tag":63,"props":7682,"children":7683},{"style":208},[7684],{"type":22,"value":7410},{"type":17,"tag":63,"props":7686,"children":7687},{"style":208},[7688],{"type":22,"value":7689}," --provider=",{"type":17,"tag":63,"props":7691,"children":7692},{"style":70},[7693],{"type":22,"value":674},{"type":17,"tag":63,"props":7695,"children":7696},{"style":208},[7697],{"type":22,"value":7698},"Spiral\\RoadRunnerLaravel\\ServiceProvider",{"type":17,"tag":63,"props":7700,"children":7701},{"style":70},[7702],{"type":22,"value":674},{"type":17,"tag":63,"props":7704,"children":7705},{"style":208},[7706],{"type":22,"value":7707}," --tag=config\n",{"type":17,"tag":24,"props":7709,"children":7710},{"id":7418},[7711],{"type":22,"value":7418},{"type":17,"tag":18,"props":7713,"children":7714},{},[7715,7717,7723],{"type":22,"value":7716},"RoadRunner 有兩個地方很重要需要做設定，一個是執行的入口點，另一個是 ",{"type":17,"tag":33,"props":7718,"children":7720},{"className":7719},[],[7721],{"type":22,"value":7722},".rr.yaml",{"type":22,"value":7724}," 參數設定檔。",{"type":17,"tag":18,"props":7726,"children":7727},{},[7728,7730,7736],{"type":22,"value":7729},"首先執行入口點因為我們專案是用 PHP Laravel 框架，剛剛已經安裝了相關套件，所以不需要另外做設定。若是使用純 PHP 那就需要在專案根目錄下新建 ",{"type":17,"tag":33,"props":7731,"children":7733},{"className":7732},[],[7734],{"type":22,"value":7735},"worker.php",{"type":22,"value":7737},"，內容大致如下(請根據專案需求、使用的框架做調整):",{"type":17,"tag":53,"props":7739,"children":7741},{"className":55,"code":7740,"language":57,"meta":8,"style":8},"\u003C?php\n\nuse Spiral\\RoadRunner;\nuse Nyholm\\Psr7;\n\ninclude \"vendor/autoload.php\";\n\n$worker = RoadRunner\\Worker::create();\n$psrFactory = new Psr7\\Factory\\Psr17Factory();\n\n$worker = new RoadRunner\\Http\\PSR7Worker($worker, $psrFactory, $psrFactory, $psrFactory);\n\nwhile ($req = $worker->waitRequest()) {\n    try {\n        $rsp = $psrFactory->createResponse();\n        $rsp->getBody()->write('Hello world! Bello!');\n\n        $worker->respond($rsp);\n    } catch (\\Throwable $e) {\n        $worker->getWorker()->error((string)$e);\n    }\n}\n",[7742],{"type":17,"tag":33,"props":7743,"children":7744},{"__ignoreMap":8},[7745,7756,7763,7788,7813,7820,7844,7851,7893,7940,7947,8038,8045,8092,8104,8141,8192,8199,8231,8271,8323,8330],{"type":17,"tag":63,"props":7746,"children":7747},{"class":65,"line":66},[7748,7752],{"type":17,"tag":63,"props":7749,"children":7750},{"style":70},[7751],{"type":22,"value":3309},{"type":17,"tag":63,"props":7753,"children":7754},{"style":76},[7755],{"type":22,"value":3314},{"type":17,"tag":63,"props":7757,"children":7758},{"class":65,"line":98},[7759],{"type":17,"tag":63,"props":7760,"children":7761},{"emptyLinePlaceholder":1409},[7762],{"type":22,"value":1412},{"type":17,"tag":63,"props":7764,"children":7765},{"class":65,"line":108},[7766,7770,7775,7779,7784],{"type":17,"tag":63,"props":7767,"children":7768},{"style":561},[7769],{"type":22,"value":3353},{"type":17,"tag":63,"props":7771,"children":7772},{"style":76},[7773],{"type":22,"value":7774}," Spiral",{"type":17,"tag":63,"props":7776,"children":7777},{"style":70},[7778],{"type":22,"value":250},{"type":17,"tag":63,"props":7780,"children":7781},{"style":76},[7782],{"type":22,"value":7783},"RoadRunner",{"type":17,"tag":63,"props":7785,"children":7786},{"style":70},[7787],{"type":22,"value":175},{"type":17,"tag":63,"props":7789,"children":7790},{"class":65,"line":133},[7791,7795,7800,7804,7809],{"type":17,"tag":63,"props":7792,"children":7793},{"style":561},[7794],{"type":22,"value":3353},{"type":17,"tag":63,"props":7796,"children":7797},{"style":76},[7798],{"type":22,"value":7799}," Nyholm",{"type":17,"tag":63,"props":7801,"children":7802},{"style":70},[7803],{"type":22,"value":250},{"type":17,"tag":63,"props":7805,"children":7806},{"style":76},[7807],{"type":22,"value":7808},"Psr7",{"type":17,"tag":63,"props":7810,"children":7811},{"style":70},[7812],{"type":22,"value":175},{"type":17,"tag":63,"props":7814,"children":7815},{"class":65,"line":178},[7816],{"type":17,"tag":63,"props":7817,"children":7818},{"emptyLinePlaceholder":1409},[7819],{"type":22,"value":1412},{"type":17,"tag":63,"props":7821,"children":7822},{"class":65,"line":474},[7823,7827,7831,7836,7840],{"type":17,"tag":63,"props":7824,"children":7825},{"style":1418},[7826],{"type":22,"value":6301},{"type":17,"tag":63,"props":7828,"children":7829},{"style":70},[7830],{"type":22,"value":642},{"type":17,"tag":63,"props":7832,"children":7833},{"style":208},[7834],{"type":22,"value":7835},"vendor/autoload.php",{"type":17,"tag":63,"props":7837,"children":7838},{"style":70},[7839],{"type":22,"value":205},{"type":17,"tag":63,"props":7841,"children":7842},{"style":70},[7843],{"type":22,"value":175},{"type":17,"tag":63,"props":7845,"children":7846},{"class":65,"line":499},[7847],{"type":17,"tag":63,"props":7848,"children":7849},{"emptyLinePlaceholder":1409},[7850],{"type":22,"value":1412},{"type":17,"tag":63,"props":7852,"children":7853},{"class":65,"line":584},[7854,7858,7863,7867,7872,7876,7881,7885,7889],{"type":17,"tag":63,"props":7855,"children":7856},{"style":70},[7857],{"type":22,"value":73},{"type":17,"tag":63,"props":7859,"children":7860},{"style":76},[7861],{"type":22,"value":7862},"worker ",{"type":17,"tag":63,"props":7864,"children":7865},{"style":70},[7866],{"type":22,"value":84},{"type":17,"tag":63,"props":7868,"children":7869},{"style":76},[7870],{"type":22,"value":7871}," RoadRunner",{"type":17,"tag":63,"props":7873,"children":7874},{"style":70},[7875],{"type":22,"value":250},{"type":17,"tag":63,"props":7877,"children":7878},{"style":182},[7879],{"type":22,"value":7880},"Worker",{"type":17,"tag":63,"props":7882,"children":7883},{"style":70},[7884],{"type":22,"value":190},{"type":17,"tag":63,"props":7886,"children":7887},{"style":87},[7888],{"type":22,"value":1654},{"type":17,"tag":63,"props":7890,"children":7891},{"style":70},[7892],{"type":22,"value":279},{"type":17,"tag":63,"props":7894,"children":7895},{"class":65,"line":731},[7896,7900,7905,7909,7913,7918,7922,7927,7931,7936],{"type":17,"tag":63,"props":7897,"children":7898},{"style":70},[7899],{"type":22,"value":73},{"type":17,"tag":63,"props":7901,"children":7902},{"style":76},[7903],{"type":22,"value":7904},"psrFactory ",{"type":17,"tag":63,"props":7906,"children":7907},{"style":70},[7908],{"type":22,"value":84},{"type":17,"tag":63,"props":7910,"children":7911},{"style":561},[7912],{"type":22,"value":3901},{"type":17,"tag":63,"props":7914,"children":7915},{"style":76},[7916],{"type":22,"value":7917}," Psr7",{"type":17,"tag":63,"props":7919,"children":7920},{"style":70},[7921],{"type":22,"value":250},{"type":17,"tag":63,"props":7923,"children":7924},{"style":76},[7925],{"type":22,"value":7926},"Factory",{"type":17,"tag":63,"props":7928,"children":7929},{"style":70},[7930],{"type":22,"value":250},{"type":17,"tag":63,"props":7932,"children":7933},{"style":182},[7934],{"type":22,"value":7935},"Psr17Factory",{"type":17,"tag":63,"props":7937,"children":7938},{"style":70},[7939],{"type":22,"value":279},{"type":17,"tag":63,"props":7941,"children":7942},{"class":65,"line":1754},[7943],{"type":17,"tag":63,"props":7944,"children":7945},{"emptyLinePlaceholder":1409},[7946],{"type":22,"value":1412},{"type":17,"tag":63,"props":7948,"children":7949},{"class":65,"line":1799},[7950,7954,7958,7962,7966,7970,7974,7979,7983,7988,7992,7997,8001,8005,8010,8014,8018,8022,8026,8030,8034],{"type":17,"tag":63,"props":7951,"children":7952},{"style":70},[7953],{"type":22,"value":73},{"type":17,"tag":63,"props":7955,"children":7956},{"style":76},[7957],{"type":22,"value":7862},{"type":17,"tag":63,"props":7959,"children":7960},{"style":70},[7961],{"type":22,"value":84},{"type":17,"tag":63,"props":7963,"children":7964},{"style":561},[7965],{"type":22,"value":3901},{"type":17,"tag":63,"props":7967,"children":7968},{"style":76},[7969],{"type":22,"value":7871},{"type":17,"tag":63,"props":7971,"children":7972},{"style":70},[7973],{"type":22,"value":250},{"type":17,"tag":63,"props":7975,"children":7976},{"style":76},[7977],{"type":22,"value":7978},"Http",{"type":17,"tag":63,"props":7980,"children":7981},{"style":70},[7982],{"type":22,"value":250},{"type":17,"tag":63,"props":7984,"children":7985},{"style":182},[7986],{"type":22,"value":7987},"PSR7Worker",{"type":17,"tag":63,"props":7989,"children":7990},{"style":70},[7991],{"type":22,"value":337},{"type":17,"tag":63,"props":7993,"children":7994},{"style":76},[7995],{"type":22,"value":7996},"worker",{"type":17,"tag":63,"props":7998,"children":7999},{"style":70},[8000],{"type":22,"value":910},{"type":17,"tag":63,"props":8002,"children":8003},{"style":70},[8004],{"type":22,"value":152},{"type":17,"tag":63,"props":8006,"children":8007},{"style":76},[8008],{"type":22,"value":8009},"psrFactory",{"type":17,"tag":63,"props":8011,"children":8012},{"style":70},[8013],{"type":22,"value":910},{"type":17,"tag":63,"props":8015,"children":8016},{"style":70},[8017],{"type":22,"value":152},{"type":17,"tag":63,"props":8019,"children":8020},{"style":76},[8021],{"type":22,"value":8009},{"type":17,"tag":63,"props":8023,"children":8024},{"style":70},[8025],{"type":22,"value":910},{"type":17,"tag":63,"props":8027,"children":8028},{"style":70},[8029],{"type":22,"value":152},{"type":17,"tag":63,"props":8031,"children":8032},{"style":76},[8033],{"type":22,"value":8009},{"type":17,"tag":63,"props":8035,"children":8036},{"style":70},[8037],{"type":22,"value":229},{"type":17,"tag":63,"props":8039,"children":8040},{"class":65,"line":1849},[8041],{"type":17,"tag":63,"props":8042,"children":8043},{"emptyLinePlaceholder":1409},[8044],{"type":22,"value":1412},{"type":17,"tag":63,"props":8046,"children":8047},{"class":65,"line":1901},[8048,8053,8057,8062,8066,8070,8074,8078,8083,8088],{"type":17,"tag":63,"props":8049,"children":8050},{"style":1418},[8051],{"type":22,"value":8052},"while",{"type":17,"tag":63,"props":8054,"children":8055},{"style":70},[8056],{"type":22,"value":608},{"type":17,"tag":63,"props":8058,"children":8059},{"style":76},[8060],{"type":22,"value":8061},"req ",{"type":17,"tag":63,"props":8063,"children":8064},{"style":70},[8065],{"type":22,"value":84},{"type":17,"tag":63,"props":8067,"children":8068},{"style":70},[8069],{"type":22,"value":152},{"type":17,"tag":63,"props":8071,"children":8072},{"style":76},[8073],{"type":22,"value":7996},{"type":17,"tag":63,"props":8075,"children":8076},{"style":70},[8077],{"type":22,"value":1774},{"type":17,"tag":63,"props":8079,"children":8080},{"style":87},[8081],{"type":22,"value":8082},"waitRequest",{"type":17,"tag":63,"props":8084,"children":8085},{"style":70},[8086],{"type":22,"value":8087},"())",{"type":17,"tag":63,"props":8089,"children":8090},{"style":70},[8091],{"type":22,"value":1452},{"type":17,"tag":63,"props":8093,"children":8094},{"class":65,"line":1952},[8095,8100],{"type":17,"tag":63,"props":8096,"children":8097},{"style":1418},[8098],{"type":22,"value":8099},"    try",{"type":17,"tag":63,"props":8101,"children":8102},{"style":70},[8103],{"type":22,"value":1452},{"type":17,"tag":63,"props":8105,"children":8106},{"class":65,"line":1961},[8107,8111,8116,8120,8124,8128,8132,8137],{"type":17,"tag":63,"props":8108,"children":8109},{"style":70},[8110],{"type":22,"value":2046},{"type":17,"tag":63,"props":8112,"children":8113},{"style":76},[8114],{"type":22,"value":8115},"rsp ",{"type":17,"tag":63,"props":8117,"children":8118},{"style":70},[8119],{"type":22,"value":84},{"type":17,"tag":63,"props":8121,"children":8122},{"style":70},[8123],{"type":22,"value":152},{"type":17,"tag":63,"props":8125,"children":8126},{"style":76},[8127],{"type":22,"value":8009},{"type":17,"tag":63,"props":8129,"children":8130},{"style":70},[8131],{"type":22,"value":1774},{"type":17,"tag":63,"props":8133,"children":8134},{"style":87},[8135],{"type":22,"value":8136},"createResponse",{"type":17,"tag":63,"props":8138,"children":8139},{"style":70},[8140],{"type":22,"value":279},{"type":17,"tag":63,"props":8142,"children":8143},{"class":65,"line":1982},[8144,8148,8153,8157,8162,8166,8171,8175,8179,8184,8188],{"type":17,"tag":63,"props":8145,"children":8146},{"style":70},[8147],{"type":22,"value":2046},{"type":17,"tag":63,"props":8149,"children":8150},{"style":76},[8151],{"type":22,"value":8152},"rsp",{"type":17,"tag":63,"props":8154,"children":8155},{"style":70},[8156],{"type":22,"value":1774},{"type":17,"tag":63,"props":8158,"children":8159},{"style":87},[8160],{"type":22,"value":8161},"getBody",{"type":17,"tag":63,"props":8163,"children":8164},{"style":70},[8165],{"type":22,"value":269},{"type":17,"tag":63,"props":8167,"children":8168},{"style":87},[8169],{"type":22,"value":8170},"write",{"type":17,"tag":63,"props":8172,"children":8173},{"style":70},[8174],{"type":22,"value":200},{"type":17,"tag":63,"props":8176,"children":8177},{"style":70},[8178],{"type":22,"value":674},{"type":17,"tag":63,"props":8180,"children":8181},{"style":208},[8182],{"type":22,"value":8183},"Hello world! Bello!",{"type":17,"tag":63,"props":8185,"children":8186},{"style":70},[8187],{"type":22,"value":674},{"type":17,"tag":63,"props":8189,"children":8190},{"style":70},[8191],{"type":22,"value":229},{"type":17,"tag":63,"props":8193,"children":8194},{"class":65,"line":1995},[8195],{"type":17,"tag":63,"props":8196,"children":8197},{"emptyLinePlaceholder":1409},[8198],{"type":22,"value":1412},{"type":17,"tag":63,"props":8200,"children":8201},{"class":65,"line":2004},[8202,8206,8210,8214,8219,8223,8227],{"type":17,"tag":63,"props":8203,"children":8204},{"style":70},[8205],{"type":22,"value":2046},{"type":17,"tag":63,"props":8207,"children":8208},{"style":76},[8209],{"type":22,"value":7996},{"type":17,"tag":63,"props":8211,"children":8212},{"style":70},[8213],{"type":22,"value":1774},{"type":17,"tag":63,"props":8215,"children":8216},{"style":87},[8217],{"type":22,"value":8218},"respond",{"type":17,"tag":63,"props":8220,"children":8221},{"style":70},[8222],{"type":22,"value":337},{"type":17,"tag":63,"props":8224,"children":8225},{"style":76},[8226],{"type":22,"value":8152},{"type":17,"tag":63,"props":8228,"children":8229},{"style":70},[8230],{"type":22,"value":229},{"type":17,"tag":63,"props":8232,"children":8233},{"class":65,"line":2013},[8234,8239,8244,8249,8254,8258,8263,8267],{"type":17,"tag":63,"props":8235,"children":8236},{"style":70},[8237],{"type":22,"value":8238},"    }",{"type":17,"tag":63,"props":8240,"children":8241},{"style":1418},[8242],{"type":22,"value":8243}," catch",{"type":17,"tag":63,"props":8245,"children":8246},{"style":70},[8247],{"type":22,"value":8248}," (\\",{"type":17,"tag":63,"props":8250,"children":8251},{"style":182},[8252],{"type":22,"value":8253},"Throwable",{"type":17,"tag":63,"props":8255,"children":8256},{"style":70},[8257],{"type":22,"value":152},{"type":17,"tag":63,"props":8259,"children":8260},{"style":76},[8261],{"type":22,"value":8262},"e",{"type":17,"tag":63,"props":8264,"children":8265},{"style":70},[8266],{"type":22,"value":553},{"type":17,"tag":63,"props":8268,"children":8269},{"style":70},[8270],{"type":22,"value":1452},{"type":17,"tag":63,"props":8272,"children":8273},{"class":65,"line":2040},[8274,8278,8282,8286,8291,8295,8300,8305,8310,8315,8319],{"type":17,"tag":63,"props":8275,"children":8276},{"style":70},[8277],{"type":22,"value":2046},{"type":17,"tag":63,"props":8279,"children":8280},{"style":76},[8281],{"type":22,"value":7996},{"type":17,"tag":63,"props":8283,"children":8284},{"style":70},[8285],{"type":22,"value":1774},{"type":17,"tag":63,"props":8287,"children":8288},{"style":87},[8289],{"type":22,"value":8290},"getWorker",{"type":17,"tag":63,"props":8292,"children":8293},{"style":70},[8294],{"type":22,"value":269},{"type":17,"tag":63,"props":8296,"children":8297},{"style":87},[8298],{"type":22,"value":8299},"error",{"type":17,"tag":63,"props":8301,"children":8302},{"style":70},[8303],{"type":22,"value":8304},"((",{"type":17,"tag":63,"props":8306,"children":8307},{"style":2296},[8308],{"type":22,"value":8309},"string",{"type":17,"tag":63,"props":8311,"children":8312},{"style":70},[8313],{"type":22,"value":8314},")$",{"type":17,"tag":63,"props":8316,"children":8317},{"style":76},[8318],{"type":22,"value":8262},{"type":17,"tag":63,"props":8320,"children":8321},{"style":70},[8322],{"type":22,"value":229},{"type":17,"tag":63,"props":8324,"children":8325},{"class":65,"line":2074},[8326],{"type":17,"tag":63,"props":8327,"children":8328},{"style":70},[8329],{"type":22,"value":2010},{"type":17,"tag":63,"props":8331,"children":8332},{"class":65,"line":2082},[8333],{"type":17,"tag":63,"props":8334,"children":8335},{"style":70},[8336],{"type":22,"value":2088},{"type":17,"tag":18,"props":8338,"children":8339},{},[8340,8342,8347,8349,8355],{"type":22,"value":8341},"再來是 ",{"type":17,"tag":33,"props":8343,"children":8345},{"className":8344},[],[8346],{"type":22,"value":7722},{"type":22,"value":8348}," 參數設定檔，",{"type":17,"tag":2386,"props":8350,"children":8353},{"href":8351,"rel":8352,"target":2391},"https://github.com/roadrunner-server/roadrunner/blob/master/.rr.yaml",[2390],[8354],{"type":22,"value":6718},{"type":22,"value":8356},"有非常多的參數可用，下例陳列部分參數用法:",{"type":17,"tag":53,"props":8358,"children":8362},{"className":8359,"code":8360,"language":8361,"meta":8,"style":8},"language-yaml shiki shiki-themes material-theme-palenight","version: '2.7'\n\nrpc:\n  listen: tcp://127.0.0.1:6001\n\nserver:\n  command: \"php ./vendor/bin/rr-worker start --relay-dsn unix:///var/run/rr-relay.sock\"\n  relay: \"unix:///var/run/rr-relay.sock\"\n\nhttp:\n  address: 0.0.0.0:8080\n  middleware: [\"static\", \"headers\", \"gzip\"]\n  pool:\n    max_jobs: 64\n    supervisor:\n      exec_ttl: 60s\n  headers:\n    response:\n      X-Powered-By: \"RoadRunner\"\n  static:\n    dir: \"public\"\n    forbid: [\".php\"]\n\n","yaml",[8363],{"type":17,"tag":33,"props":8364,"children":8365},{"__ignoreMap":8},[8366,8392,8399,8412,8429,8436,8447,8473,8498,8505,8517,8534,8602,8614,8631,8643,8660,8672,8684,8708,8720,8744],{"type":17,"tag":63,"props":8367,"children":8368},{"class":65,"line":66},[8369,8374,8378,8382,8387],{"type":17,"tag":63,"props":8370,"children":8371},{"style":4773},[8372],{"type":22,"value":8373},"version",{"type":17,"tag":63,"props":8375,"children":8376},{"style":70},[8377],{"type":22,"value":3127},{"type":17,"tag":63,"props":8379,"children":8380},{"style":70},[8381],{"type":22,"value":896},{"type":17,"tag":63,"props":8383,"children":8384},{"style":208},[8385],{"type":22,"value":8386},"2.7",{"type":17,"tag":63,"props":8388,"children":8389},{"style":70},[8390],{"type":22,"value":8391},"'\n",{"type":17,"tag":63,"props":8393,"children":8394},{"class":65,"line":98},[8395],{"type":17,"tag":63,"props":8396,"children":8397},{"emptyLinePlaceholder":1409},[8398],{"type":22,"value":1412},{"type":17,"tag":63,"props":8400,"children":8401},{"class":65,"line":108},[8402,8407],{"type":17,"tag":63,"props":8403,"children":8404},{"style":4773},[8405],{"type":22,"value":8406},"rpc",{"type":17,"tag":63,"props":8408,"children":8409},{"style":70},[8410],{"type":22,"value":8411},":\n",{"type":17,"tag":63,"props":8413,"children":8414},{"class":65,"line":133},[8415,8420,8424],{"type":17,"tag":63,"props":8416,"children":8417},{"style":4773},[8418],{"type":22,"value":8419},"  listen",{"type":17,"tag":63,"props":8421,"children":8422},{"style":70},[8423],{"type":22,"value":3127},{"type":17,"tag":63,"props":8425,"children":8426},{"style":208},[8427],{"type":22,"value":8428}," tcp://127.0.0.1:6001\n",{"type":17,"tag":63,"props":8430,"children":8431},{"class":65,"line":178},[8432],{"type":17,"tag":63,"props":8433,"children":8434},{"emptyLinePlaceholder":1409},[8435],{"type":22,"value":1412},{"type":17,"tag":63,"props":8437,"children":8438},{"class":65,"line":474},[8439,8443],{"type":17,"tag":63,"props":8440,"children":8441},{"style":4773},[8442],{"type":22,"value":4731},{"type":17,"tag":63,"props":8444,"children":8445},{"style":70},[8446],{"type":22,"value":8411},{"type":17,"tag":63,"props":8448,"children":8449},{"class":65,"line":499},[8450,8455,8459,8463,8468],{"type":17,"tag":63,"props":8451,"children":8452},{"style":4773},[8453],{"type":22,"value":8454},"  command",{"type":17,"tag":63,"props":8456,"children":8457},{"style":70},[8458],{"type":22,"value":3127},{"type":17,"tag":63,"props":8460,"children":8461},{"style":70},[8462],{"type":22,"value":642},{"type":17,"tag":63,"props":8464,"children":8465},{"style":208},[8466],{"type":22,"value":8467},"php ./vendor/bin/rr-worker start --relay-dsn unix:///var/run/rr-relay.sock",{"type":17,"tag":63,"props":8469,"children":8470},{"style":70},[8471],{"type":22,"value":8472},"\"\n",{"type":17,"tag":63,"props":8474,"children":8475},{"class":65,"line":584},[8476,8481,8485,8489,8494],{"type":17,"tag":63,"props":8477,"children":8478},{"style":4773},[8479],{"type":22,"value":8480},"  relay",{"type":17,"tag":63,"props":8482,"children":8483},{"style":70},[8484],{"type":22,"value":3127},{"type":17,"tag":63,"props":8486,"children":8487},{"style":70},[8488],{"type":22,"value":642},{"type":17,"tag":63,"props":8490,"children":8491},{"style":208},[8492],{"type":22,"value":8493},"unix:///var/run/rr-relay.sock",{"type":17,"tag":63,"props":8495,"children":8496},{"style":70},[8497],{"type":22,"value":8472},{"type":17,"tag":63,"props":8499,"children":8500},{"class":65,"line":731},[8501],{"type":17,"tag":63,"props":8502,"children":8503},{"emptyLinePlaceholder":1409},[8504],{"type":22,"value":1412},{"type":17,"tag":63,"props":8506,"children":8507},{"class":65,"line":1754},[8508,8513],{"type":17,"tag":63,"props":8509,"children":8510},{"style":4773},[8511],{"type":22,"value":8512},"http",{"type":17,"tag":63,"props":8514,"children":8515},{"style":70},[8516],{"type":22,"value":8411},{"type":17,"tag":63,"props":8518,"children":8519},{"class":65,"line":1799},[8520,8525,8529],{"type":17,"tag":63,"props":8521,"children":8522},{"style":4773},[8523],{"type":22,"value":8524},"  address",{"type":17,"tag":63,"props":8526,"children":8527},{"style":70},[8528],{"type":22,"value":3127},{"type":17,"tag":63,"props":8530,"children":8531},{"style":208},[8532],{"type":22,"value":8533}," 0.0.0.0:8080\n",{"type":17,"tag":63,"props":8535,"children":8536},{"class":65,"line":1849},[8537,8542,8546,8550,8554,8559,8563,8567,8571,8576,8580,8584,8588,8593,8597],{"type":17,"tag":63,"props":8538,"children":8539},{"style":4773},[8540],{"type":22,"value":8541},"  middleware",{"type":17,"tag":63,"props":8543,"children":8544},{"style":70},[8545],{"type":22,"value":3127},{"type":17,"tag":63,"props":8547,"children":8548},{"style":70},[8549],{"type":22,"value":950},{"type":17,"tag":63,"props":8551,"children":8552},{"style":70},[8553],{"type":22,"value":205},{"type":17,"tag":63,"props":8555,"children":8556},{"style":208},[8557],{"type":22,"value":8558},"static",{"type":17,"tag":63,"props":8560,"children":8561},{"style":70},[8562],{"type":22,"value":205},{"type":17,"tag":63,"props":8564,"children":8565},{"style":70},[8566],{"type":22,"value":910},{"type":17,"tag":63,"props":8568,"children":8569},{"style":70},[8570],{"type":22,"value":642},{"type":17,"tag":63,"props":8572,"children":8573},{"style":208},[8574],{"type":22,"value":8575},"headers",{"type":17,"tag":63,"props":8577,"children":8578},{"style":70},[8579],{"type":22,"value":205},{"type":17,"tag":63,"props":8581,"children":8582},{"style":70},[8583],{"type":22,"value":910},{"type":17,"tag":63,"props":8585,"children":8586},{"style":70},[8587],{"type":22,"value":642},{"type":17,"tag":63,"props":8589,"children":8590},{"style":208},[8591],{"type":22,"value":8592},"gzip",{"type":17,"tag":63,"props":8594,"children":8595},{"style":70},[8596],{"type":22,"value":205},{"type":17,"tag":63,"props":8598,"children":8599},{"style":70},[8600],{"type":22,"value":8601},"]\n",{"type":17,"tag":63,"props":8603,"children":8604},{"class":65,"line":1901},[8605,8610],{"type":17,"tag":63,"props":8606,"children":8607},{"style":4773},[8608],{"type":22,"value":8609},"  pool",{"type":17,"tag":63,"props":8611,"children":8612},{"style":70},[8613],{"type":22,"value":8411},{"type":17,"tag":63,"props":8615,"children":8616},{"class":65,"line":1952},[8617,8622,8626],{"type":17,"tag":63,"props":8618,"children":8619},{"style":4773},[8620],{"type":22,"value":8621},"    max_jobs",{"type":17,"tag":63,"props":8623,"children":8624},{"style":70},[8625],{"type":22,"value":3127},{"type":17,"tag":63,"props":8627,"children":8628},{"style":561},[8629],{"type":22,"value":8630}," 64\n",{"type":17,"tag":63,"props":8632,"children":8633},{"class":65,"line":1961},[8634,8639],{"type":17,"tag":63,"props":8635,"children":8636},{"style":4773},[8637],{"type":22,"value":8638},"    supervisor",{"type":17,"tag":63,"props":8640,"children":8641},{"style":70},[8642],{"type":22,"value":8411},{"type":17,"tag":63,"props":8644,"children":8645},{"class":65,"line":1982},[8646,8651,8655],{"type":17,"tag":63,"props":8647,"children":8648},{"style":4773},[8649],{"type":22,"value":8650},"      exec_ttl",{"type":17,"tag":63,"props":8652,"children":8653},{"style":70},[8654],{"type":22,"value":3127},{"type":17,"tag":63,"props":8656,"children":8657},{"style":208},[8658],{"type":22,"value":8659}," 60s\n",{"type":17,"tag":63,"props":8661,"children":8662},{"class":65,"line":1995},[8663,8668],{"type":17,"tag":63,"props":8664,"children":8665},{"style":4773},[8666],{"type":22,"value":8667},"  headers",{"type":17,"tag":63,"props":8669,"children":8670},{"style":70},[8671],{"type":22,"value":8411},{"type":17,"tag":63,"props":8673,"children":8674},{"class":65,"line":2004},[8675,8680],{"type":17,"tag":63,"props":8676,"children":8677},{"style":4773},[8678],{"type":22,"value":8679},"    response",{"type":17,"tag":63,"props":8681,"children":8682},{"style":70},[8683],{"type":22,"value":8411},{"type":17,"tag":63,"props":8685,"children":8686},{"class":65,"line":2013},[8687,8692,8696,8700,8704],{"type":17,"tag":63,"props":8688,"children":8689},{"style":4773},[8690],{"type":22,"value":8691},"      X-Powered-By",{"type":17,"tag":63,"props":8693,"children":8694},{"style":70},[8695],{"type":22,"value":3127},{"type":17,"tag":63,"props":8697,"children":8698},{"style":70},[8699],{"type":22,"value":642},{"type":17,"tag":63,"props":8701,"children":8702},{"style":208},[8703],{"type":22,"value":7783},{"type":17,"tag":63,"props":8705,"children":8706},{"style":70},[8707],{"type":22,"value":8472},{"type":17,"tag":63,"props":8709,"children":8710},{"class":65,"line":2040},[8711,8716],{"type":17,"tag":63,"props":8712,"children":8713},{"style":4773},[8714],{"type":22,"value":8715},"  static",{"type":17,"tag":63,"props":8717,"children":8718},{"style":70},[8719],{"type":22,"value":8411},{"type":17,"tag":63,"props":8721,"children":8722},{"class":65,"line":2074},[8723,8728,8732,8736,8740],{"type":17,"tag":63,"props":8724,"children":8725},{"style":4773},[8726],{"type":22,"value":8727},"    dir",{"type":17,"tag":63,"props":8729,"children":8730},{"style":70},[8731],{"type":22,"value":3127},{"type":17,"tag":63,"props":8733,"children":8734},{"style":70},[8735],{"type":22,"value":642},{"type":17,"tag":63,"props":8737,"children":8738},{"style":208},[8739],{"type":22,"value":2413},{"type":17,"tag":63,"props":8741,"children":8742},{"style":70},[8743],{"type":22,"value":8472},{"type":17,"tag":63,"props":8745,"children":8746},{"class":65,"line":2082},[8747,8752,8756,8760,8764,8769,8773],{"type":17,"tag":63,"props":8748,"children":8749},{"style":4773},[8750],{"type":22,"value":8751},"    forbid",{"type":17,"tag":63,"props":8753,"children":8754},{"style":70},[8755],{"type":22,"value":3127},{"type":17,"tag":63,"props":8757,"children":8758},{"style":70},[8759],{"type":22,"value":950},{"type":17,"tag":63,"props":8761,"children":8762},{"style":70},[8763],{"type":22,"value":205},{"type":17,"tag":63,"props":8765,"children":8766},{"style":208},[8767],{"type":22,"value":8768},".php",{"type":17,"tag":63,"props":8770,"children":8771},{"style":70},[8772],{"type":22,"value":205},{"type":17,"tag":63,"props":8774,"children":8775},{"style":70},[8776],{"type":22,"value":8601},{"type":17,"tag":24,"props":8778,"children":8779},{"id":7463},[8780],{"type":22,"value":7463},{"type":17,"tag":18,"props":8782,"children":8783},{},[8784,8786,8792],{"type":22,"value":8785},"以上設定完後，下 ",{"type":17,"tag":33,"props":8787,"children":8789},{"className":8788},[],[8790],{"type":22,"value":8791},"rr serve -c ./.rr.yaml",{"type":22,"value":7478},{"type":17,"tag":24,"props":8794,"children":8795},{"id":7481},[8796],{"type":22,"value":7481},{"type":17,"tag":18,"props":8798,"children":8799},{},[8800,8802,8808],{"type":22,"value":8801},"使用 ",{"type":17,"tag":33,"props":8803,"children":8805},{"className":8804},[],[8806],{"type":22,"value":8807},"serialize()",{"type":22,"value":8809}," 序列化作測試函數，分別用 FPM 和 RoadRunner 各做一百萬和五百萬次的測試，如下圖所示，Request 也分別用 1 和 3 來測試執行的時間：",{"type":17,"tag":5340,"props":8811,"children":8813},{"src":8812},"articles/php-laravel-roadrunner-first-experience-1.png",[],{"type":17,"tag":18,"props":8815,"children":8816},{},[8817],{"type":22,"value":8818},"由上圖可發現，在一百萬次的 FPM 和 RoadRunner 表現效果差不多，Request 數為 3 時開始有些微的時間差距；在五百萬次的 FPM 和 RoadRunner 表現效果越來越明顯，再加上Request 數為 3 時，我把 RoadRunner 的 worker 提高成 2 個，速度就比 FPM 快一些。這邊測試的環境皆為 1 CPU，兩者的 work_processes 皆為 1。",{"type":17,"tag":24,"props":8820,"children":8821},{"id":7267},[8822],{"type":22,"value":7267},{"type":17,"tag":18,"props":8824,"children":8825},{},[8826],{"type":22,"value":8827},"初體驗 RoadRunner 的確速度上快於 FPM，即便沒有額外調整設定也是快於 FPM，不過 FPM 和 RoadRunner 各有優缺點，要根據專案的需求決定要採用哪個工具。RoadRunner 畢竟社群還不夠廣且對大家的熟悉度不高，而目前業界普遍使用 FPM 偏高，期待 RoadRunner 官方能提供更多功能且更完善的文件方便各位工程師們使用！",{"type":17,"tag":24,"props":8829,"children":8831},{"id":8830},"參考文件",[8832],{"type":22,"value":8830},{"type":17,"tag":2636,"props":8834,"children":8835},{},[8836,8845,8853],{"type":17,"tag":2640,"props":8837,"children":8838},{},[8839],{"type":17,"tag":2386,"props":8840,"children":8843},{"href":8841,"rel":8842,"target":2391},"https://roadrunner.dev/docs/intro-install/2.x/en",[2390],[8844],{"type":22,"value":8841},{"type":17,"tag":2640,"props":8846,"children":8847},{},[8848],{"type":17,"tag":2386,"props":8849,"children":8851},{"href":8351,"rel":8850,"target":2391},[2390],[8852],{"type":22,"value":8351},{"type":17,"tag":2640,"props":8854,"children":8855},{},[8856],{"type":17,"tag":2386,"props":8857,"children":8860},{"href":8858,"rel":8859,"target":2391},"https://github.com/spiral/roadrunner-laravel",[2390],[8861],{"type":22,"value":8858},{"type":17,"tag":810,"props":8863,"children":8864},{},[8865],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":8867},[8868,8869,8870,8871,8872,8873],{"id":7304,"depth":98,"text":7304},{"id":7418,"depth":98,"text":7418},{"id":7463,"depth":98,"text":7463},{"id":7481,"depth":98,"text":7481},{"id":7267,"depth":98,"text":7267},{"id":8830,"depth":98,"text":8830},"content:article:coding:php-laravel-roadrunner-first-experience.md","article/coding/php-laravel-roadrunner-first-experience.md","article/coding/php-laravel-roadrunner-first-experience",{"_path":8878,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":8879,"description":8880,"category":6,"createdAt":8881,"updatedAt":8881,"body":8882,"_type":821,"_id":9038,"_source":823,"_file":9039,"_stem":9040,"_extension":826},"/article/coding/mysql-ddl-dml-dql-dcl-definition","MySQL 資料庫四大分類名詞定義: DDL、DML、DQL、DCL","MySQL 基本操作的四大分類：DDL 資料定義語言、DML 資料操作語言、DQL 資料查詢語言、DCL 資料控制語言。以下各別介紹名詞定義：","2022-08-19",{"type":14,"children":8883,"toc":9032},[8884,8888,8894,8939,8945,8981,8987,9006,9012],{"type":17,"tag":18,"props":8885,"children":8886},{},[8887],{"type":22,"value":8880},{"type":17,"tag":24,"props":8889,"children":8891},{"id":8890},"ddl-資料定義語言data-definition-language",[8892],{"type":22,"value":8893},"DDL 資料定義語言(Data Definition Language)",{"type":17,"tag":18,"props":8895,"children":8896},{},[8897,8899,8905,8907,8913,8915,8921,8923,8929,8931,8937],{"type":22,"value":8898},"主要用來定義資料庫中的項目，包括新增使用者",{"type":17,"tag":33,"props":8900,"children":8902},{"className":8901},[],[8903],{"type":22,"value":8904},"USER",{"type":22,"value":8906},"、資料庫",{"type":17,"tag":33,"props":8908,"children":8910},{"className":8909},[],[8911],{"type":22,"value":8912},"DATABASE",{"type":22,"value":8914},"、資料表",{"type":17,"tag":33,"props":8916,"children":8918},{"className":8917},[],[8919],{"type":22,"value":8920},"TABLE",{"type":22,"value":8922},"、檢視表",{"type":17,"tag":33,"props":8924,"children":8926},{"className":8925},[],[8927],{"type":22,"value":8928},"VIEW",{"type":22,"value":8930},"、索引",{"type":17,"tag":33,"props":8932,"children":8934},{"className":8933},[],[8935],{"type":22,"value":8936},"INDEX",{"type":22,"value":8938},"...等功能。",{"type":17,"tag":24,"props":8940,"children":8942},{"id":8941},"dml-資料操作語言data-manipulation-language",[8943],{"type":22,"value":8944},"DML 資料操作語言(Data Manipulation Language)",{"type":17,"tag":18,"props":8946,"children":8947},{},[8948,8950,8955,8957,8963,8965,8971,8973,8979],{"type":22,"value":8949},"用來操作資料表",{"type":17,"tag":33,"props":8951,"children":8953},{"className":8952},[],[8954],{"type":22,"value":8920},{"type":22,"value":8956},"內的資料，包含新增",{"type":17,"tag":33,"props":8958,"children":8960},{"className":8959},[],[8961],{"type":22,"value":8962},"INSERT",{"type":22,"value":8964},"、修改",{"type":17,"tag":33,"props":8966,"children":8968},{"className":8967},[],[8969],{"type":22,"value":8970},"UPDATE",{"type":22,"value":8972},"、刪除",{"type":17,"tag":33,"props":8974,"children":8976},{"className":8975},[],[8977],{"type":22,"value":8978},"DELETE",{"type":22,"value":8980},"等功能。",{"type":17,"tag":24,"props":8982,"children":8984},{"id":8983},"dql-資料查詢語言data-query-language",[8985],{"type":22,"value":8986},"DQL 資料查詢語言(Data Query Language)",{"type":17,"tag":18,"props":8988,"children":8989},{},[8990,8992,8997,8999,9005],{"type":22,"value":8991},"用來查看資料表",{"type":17,"tag":33,"props":8993,"children":8995},{"className":8994},[],[8996],{"type":22,"value":8920},{"type":22,"value":8998},"中的資料，主要為查詢",{"type":17,"tag":33,"props":9000,"children":9002},{"className":9001},[],[9003],{"type":22,"value":9004},"SELECT",{"type":22,"value":6720},{"type":17,"tag":24,"props":9007,"children":9009},{"id":9008},"dcl-資料控制語言data-control-language",[9010],{"type":22,"value":9011},"DCL 資料控制語言(Data Control Language)",{"type":17,"tag":18,"props":9013,"children":9014},{},[9015,9017,9023,9025,9031],{"type":22,"value":9016},"授權或撤回訪問資料庫的權限，包含授權",{"type":17,"tag":33,"props":9018,"children":9020},{"className":9019},[],[9021],{"type":22,"value":9022},"GRANT",{"type":22,"value":9024},"、撤回",{"type":17,"tag":33,"props":9026,"children":9028},{"className":9027},[],[9029],{"type":22,"value":9030},"REVOKE",{"type":22,"value":6720},{"title":8,"searchDepth":98,"depth":98,"links":9033},[9034,9035,9036,9037],{"id":8890,"depth":98,"text":8893},{"id":8941,"depth":98,"text":8944},{"id":8983,"depth":98,"text":8986},{"id":9008,"depth":98,"text":9011},"content:article:coding:mysql-ddl-dml-dql-dcl-definition.md","article/coding/mysql-ddl-dml-dql-dcl-definition.md","article/coding/mysql-ddl-dml-dql-dcl-definition",{"_path":9042,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9043,"description":9044,"category":6,"createdAt":9045,"updatedAt":9046,"body":9047,"_type":821,"_id":9929,"_source":823,"_file":9930,"_stem":9931,"_extension":826},"/article/coding/javascript-regular-expression","Javascript 正則表達式 Regular Expression 詳細範例用法","每次要用正則表達式 Regular Expression 的時候，很容易忘記它的規則，因為英文我看的比較習慣且解釋的很精確，所以以下就用英文說明在 Javascript 中詳細範例用法：","2022-07-02","2022-07-30",{"type":14,"children":9048,"toc":9920},[9049,9053,9058,9237,9242,9312,9317,9385,9390,9590,9595,9706,9709,9715,9720,9728,9812,9817,9825,9862,9870,9878,9912],{"type":17,"tag":18,"props":9050,"children":9051},{},[9052],{"type":22,"value":9044},{"type":17,"tag":24,"props":9054,"children":9056},{"id":9055},"文字",[9057],{"type":22,"value":9055},{"type":17,"tag":3151,"props":9059,"children":9060},{},[9061,9084],{"type":17,"tag":9062,"props":9063,"children":9064},"thead",{},[9065],{"type":17,"tag":9066,"props":9067,"children":9068},"tr",{},[9069,9075,9080],{"type":17,"tag":9070,"props":9071,"children":9072},"th",{},[9073],{"type":22,"value":9074},"用法",{"type":17,"tag":9070,"props":9076,"children":9077},{},[9078],{"type":22,"value":9079},"說明",{"type":17,"tag":9070,"props":9081,"children":9082},{},[9083],{"type":22,"value":1348},{"type":17,"tag":9085,"props":9086,"children":9087},"tbody",{},[9088,9104,9127,9142,9158,9174,9195,9216],{"type":17,"tag":9066,"props":9089,"children":9090},{},[9091,9096,9101],{"type":17,"tag":9092,"props":9093,"children":9094},"td",{},[9095],{"type":22,"value":2555},{"type":17,"tag":9092,"props":9097,"children":9098},{},[9099],{"type":22,"value":9100},"Any character except newline.",{"type":17,"tag":9092,"props":9102,"children":9103},{},[],{"type":17,"tag":9066,"props":9105,"children":9106},{},[9107,9112,9117],{"type":17,"tag":9092,"props":9108,"children":9109},{},[9110],{"type":22,"value":9111},"\\w",{"type":17,"tag":9092,"props":9113,"children":9114},{},[9115],{"type":22,"value":9116},"Word. Alphanumeric & Underscore",{"type":17,"tag":9092,"props":9118,"children":9119},{},[9120,9122],{"type":22,"value":9121},"Equivalent to ",{"type":17,"tag":63,"props":9123,"children":9124},{},[9125],{"type":22,"value":9126},"A-Za-z0-9_",{"type":17,"tag":9066,"props":9128,"children":9129},{},[9130,9134,9139],{"type":17,"tag":9092,"props":9131,"children":9132},{},[9133],{"type":22,"value":2778},{"type":17,"tag":9092,"props":9135,"children":9136},{},[9137],{"type":22,"value":9138},"Digit. 0-9",{"type":17,"tag":9092,"props":9140,"children":9141},{},[],{"type":17,"tag":9066,"props":9143,"children":9144},{},[9145,9150,9155],{"type":17,"tag":9092,"props":9146,"children":9147},{},[9148],{"type":22,"value":9149},"\\s",{"type":17,"tag":9092,"props":9151,"children":9152},{},[9153],{"type":22,"value":9154},"Whitespace. Spaces & Tabs & Line breaks",{"type":17,"tag":9092,"props":9156,"children":9157},{},[],{"type":17,"tag":9066,"props":9159,"children":9160},{},[9161,9166,9171],{"type":17,"tag":9092,"props":9162,"children":9163},{},[9164],{"type":22,"value":9165},"\\W \\D \\S",{"type":17,"tag":9092,"props":9167,"children":9168},{},[9169],{"type":22,"value":9170},"Reverse \\w, \\d, \\s",{"type":17,"tag":9092,"props":9172,"children":9173},{},[],{"type":17,"tag":9066,"props":9175,"children":9176},{},[9177,9185,9190],{"type":17,"tag":9092,"props":9178,"children":9179},{},[9180],{"type":17,"tag":63,"props":9181,"children":9182},{},[9183],{"type":22,"value":9184},"abc",{"type":17,"tag":9092,"props":9186,"children":9187},{},[9188],{"type":22,"value":9189},"Match any character in the set.",{"type":17,"tag":9092,"props":9191,"children":9192},{},[9193],{"type":22,"value":9194},"any of a, b, c",{"type":17,"tag":9066,"props":9196,"children":9197},{},[9198,9206,9211],{"type":17,"tag":9092,"props":9199,"children":9200},{},[9201],{"type":17,"tag":63,"props":9202,"children":9203},{},[9204],{"type":22,"value":9205},"^abc",{"type":17,"tag":9092,"props":9207,"children":9208},{},[9209],{"type":22,"value":9210},"Match any character that is not in the set.",{"type":17,"tag":9092,"props":9212,"children":9213},{},[9214],{"type":22,"value":9215},"not a, b, or c",{"type":17,"tag":9066,"props":9217,"children":9218},{},[9219,9227,9232],{"type":17,"tag":9092,"props":9220,"children":9221},{},[9222],{"type":17,"tag":63,"props":9223,"children":9224},{},[9225],{"type":22,"value":9226},"a-z",{"type":17,"tag":9092,"props":9228,"children":9229},{},[9230],{"type":22,"value":9231},"Matches a character having a character code between the two specified characters inclusive.",{"type":17,"tag":9092,"props":9233,"children":9234},{},[9235],{"type":22,"value":9236},"character between a & z",{"type":17,"tag":24,"props":9238,"children":9240},{"id":9239},"位置",[9241],{"type":22,"value":9239},{"type":17,"tag":3151,"props":9243,"children":9244},{},[9245,9263],{"type":17,"tag":9062,"props":9246,"children":9247},{},[9248],{"type":17,"tag":9066,"props":9249,"children":9250},{},[9251,9255,9259],{"type":17,"tag":9070,"props":9252,"children":9253},{},[9254],{"type":22,"value":9074},{"type":17,"tag":9070,"props":9256,"children":9257},{},[9258],{"type":22,"value":9079},{"type":17,"tag":9070,"props":9260,"children":9261},{},[9262],{"type":22,"value":1348},{"type":17,"tag":9085,"props":9264,"children":9265},{},[9266,9282],{"type":17,"tag":9066,"props":9267,"children":9268},{},[9269,9274,9279],{"type":17,"tag":9092,"props":9270,"children":9271},{},[9272],{"type":22,"value":9273},"^abc$",{"type":17,"tag":9092,"props":9275,"children":9276},{},[9277],{"type":22,"value":9278},"Matches start / end of the string.",{"type":17,"tag":9092,"props":9280,"children":9281},{},[],{"type":17,"tag":9066,"props":9283,"children":9284},{},[9285,9290,9295],{"type":17,"tag":9092,"props":9286,"children":9287},{},[9288],{"type":22,"value":9289},"\\b \\B",{"type":17,"tag":9092,"props":9291,"children":9292},{},[9293],{"type":22,"value":9294},"Word, not-word boundary",{"type":17,"tag":9092,"props":9296,"children":9297},{},[9298,9300,9306,9308],{"type":22,"value":9299},"/s\\b/g => she ha",{"type":17,"tag":9301,"props":9302,"children":9303},"b",{},[9304],{"type":22,"value":9305},"s",{"type":22,"value":9307}," many sister",{"type":17,"tag":9301,"props":9309,"children":9310},{},[9311],{"type":22,"value":9305},{"type":17,"tag":24,"props":9313,"children":9315},{"id":9314},"跳脫字元",[9316],{"type":22,"value":9314},{"type":17,"tag":3151,"props":9318,"children":9319},{},[9320,9338],{"type":17,"tag":9062,"props":9321,"children":9322},{},[9323],{"type":17,"tag":9066,"props":9324,"children":9325},{},[9326,9330,9334],{"type":17,"tag":9070,"props":9327,"children":9328},{},[9329],{"type":22,"value":9074},{"type":17,"tag":9070,"props":9331,"children":9332},{},[9333],{"type":22,"value":9079},{"type":17,"tag":9070,"props":9335,"children":9336},{},[9337],{"type":22,"value":1348},{"type":17,"tag":9085,"props":9339,"children":9340},{},[9341,9369],{"type":17,"tag":9066,"props":9342,"children":9343},{},[9344,9348,9364],{"type":17,"tag":9092,"props":9345,"children":9346},{},[9347],{"type":22,"value":250},{"type":17,"tag":9092,"props":9349,"children":9350},{},[9351,9353,9356,9358,9362],{"type":22,"value":9352},"Escaped special characters, including: +*?^$\\.",{"type":17,"tag":63,"props":9354,"children":9355},{},[],{"type":22,"value":9357},"()|/ ",{"type":17,"tag":9359,"props":9360,"children":9361},"br",{},[],{"type":22,"value":9363}," Within a character set, only , -, and ] need to be escaped.",{"type":17,"tag":9092,"props":9365,"children":9366},{},[9367],{"type":22,"value":9368},"\\. \\* \\\\",{"type":17,"tag":9066,"props":9370,"children":9371},{},[9372,9377,9382],{"type":17,"tag":9092,"props":9373,"children":9374},{},[9375],{"type":22,"value":9376},"\\t \\n \\r",{"type":17,"tag":9092,"props":9378,"children":9379},{},[9380],{"type":22,"value":9381},"Tab, linefeed, carriage return",{"type":17,"tag":9092,"props":9383,"children":9384},{},[],{"type":17,"tag":24,"props":9386,"children":9388},{"id":9387},"群組",[9389],{"type":22,"value":9387},{"type":17,"tag":3151,"props":9391,"children":9392},{},[9393,9411],{"type":17,"tag":9062,"props":9394,"children":9395},{},[9396],{"type":17,"tag":9066,"props":9397,"children":9398},{},[9399,9403,9407],{"type":17,"tag":9070,"props":9400,"children":9401},{},[9402],{"type":22,"value":9074},{"type":17,"tag":9070,"props":9404,"children":9405},{},[9406],{"type":22,"value":9079},{"type":17,"tag":9070,"props":9408,"children":9409},{},[9410],{"type":22,"value":1348},{"type":17,"tag":9085,"props":9412,"children":9413},{},[9414,9461,9498,9522,9546,9568],{"type":17,"tag":9066,"props":9415,"children":9416},{},[9417,9422,9427],{"type":17,"tag":9092,"props":9418,"children":9419},{},[9420],{"type":22,"value":9421},"(abc)",{"type":17,"tag":9092,"props":9423,"children":9424},{},[9425],{"type":22,"value":9426},"Capture group",{"type":17,"tag":9092,"props":9428,"children":9429},{},[9430,9432,9437,9439,9449,9451,9454,9456,9459],{"type":22,"value":9431},"/(https?):\\/\\/(",{"type":17,"tag":63,"props":9433,"children":9434},{},[9435],{"type":22,"value":9436},"^\\r\\n",{"type":22,"value":9438},"+)/g => ",{"type":17,"tag":9301,"props":9440,"children":9441},{},[9442,9447],{"type":17,"tag":63,"props":9443,"children":9444},{},[9445],{"type":22,"value":9446},"https://",{"type":22,"value":9448},"google.com/",{"type":22,"value":9450}," ",{"type":17,"tag":9359,"props":9452,"children":9453},{},[],{"type":22,"value":9455}," Group 1: \"https:\" ",{"type":17,"tag":9359,"props":9457,"children":9458},{},[],{"type":22,"value":9460}," Group 2: \"google.com/\"",{"type":17,"tag":9066,"props":9462,"children":9463},{},[9464,9469,9474],{"type":17,"tag":9092,"props":9465,"children":9466},{},[9467],{"type":22,"value":9468},"(?:abc)",{"type":17,"tag":9092,"props":9470,"children":9471},{},[9472],{"type":22,"value":9473},"Non-capturing group",{"type":17,"tag":9092,"props":9475,"children":9476},{},[9477,9479,9483,9484,9492,9493,9496],{"type":22,"value":9478},"/(?:https?):\\/\\/(",{"type":17,"tag":63,"props":9480,"children":9481},{},[9482],{"type":22,"value":9436},{"type":22,"value":9438},{"type":17,"tag":9301,"props":9485,"children":9486},{},[9487,9491],{"type":17,"tag":63,"props":9488,"children":9489},{},[9490],{"type":22,"value":9446},{"type":22,"value":9448},{"type":22,"value":9450},{"type":17,"tag":9359,"props":9494,"children":9495},{},[],{"type":22,"value":9497}," Group 1: \"google.com/\"",{"type":17,"tag":9066,"props":9499,"children":9500},{},[9501,9506,9511],{"type":17,"tag":9092,"props":9502,"children":9503},{},[9504],{"type":22,"value":9505},"x(?=abc)",{"type":17,"tag":9092,"props":9507,"children":9508},{},[9509],{"type":22,"value":9510},"Positive lookahead. Matches only if followed by condition and without including it in the result.",{"type":17,"tag":9092,"props":9512,"children":9513},{},[9514,9516,9521],{"type":22,"value":9515},"/x(?=abc)/g => ",{"type":17,"tag":9301,"props":9517,"children":9518},{},[9519],{"type":22,"value":9520},"x",{"type":22,"value":9184},{"type":17,"tag":9066,"props":9523,"children":9524},{},[9525,9530,9535],{"type":17,"tag":9092,"props":9526,"children":9527},{},[9528],{"type":22,"value":9529},"x(?!abc)",{"type":17,"tag":9092,"props":9531,"children":9532},{},[9533],{"type":22,"value":9534},"Negative lookahead. Matches only if not followed by condition and without including it in the result.",{"type":17,"tag":9092,"props":9536,"children":9537},{},[9538,9540,9544],{"type":22,"value":9539},"/x(?!abc)/g => ",{"type":17,"tag":9301,"props":9541,"children":9542},{},[9543],{"type":22,"value":9520},{"type":22,"value":9545},"def",{"type":17,"tag":9066,"props":9547,"children":9548},{},[9549,9554,9559],{"type":17,"tag":9092,"props":9550,"children":9551},{},[9552],{"type":22,"value":9553},"(?\u003C=abc)x",{"type":17,"tag":9092,"props":9555,"children":9556},{},[9557],{"type":22,"value":9558},"Positive lookbehind. Matches only if preceded by condition and without including it in the result.",{"type":17,"tag":9092,"props":9560,"children":9561},{},[9562,9564],{"type":22,"value":9563},"/(?\u003C=abc)x/g => abc",{"type":17,"tag":9301,"props":9565,"children":9566},{},[9567],{"type":22,"value":9520},{"type":17,"tag":9066,"props":9569,"children":9570},{},[9571,9576,9581],{"type":17,"tag":9092,"props":9572,"children":9573},{},[9574],{"type":22,"value":9575},"(?\u003C!abc)x",{"type":17,"tag":9092,"props":9577,"children":9578},{},[9579],{"type":22,"value":9580},"Negative lookbehind. Matches only if not preceded by condition and without including it in the result.",{"type":17,"tag":9092,"props":9582,"children":9583},{},[9584,9586],{"type":22,"value":9585},"/(?\u003C!abc)x/g => def",{"type":17,"tag":9301,"props":9587,"children":9588},{},[9589],{"type":22,"value":9520},{"type":17,"tag":24,"props":9591,"children":9593},{"id":9592},"數量",[9594],{"type":22,"value":9592},{"type":17,"tag":3151,"props":9596,"children":9597},{},[9598,9616],{"type":17,"tag":9062,"props":9599,"children":9600},{},[9601],{"type":17,"tag":9066,"props":9602,"children":9603},{},[9604,9608,9612],{"type":17,"tag":9070,"props":9605,"children":9606},{},[9607],{"type":22,"value":9074},{"type":17,"tag":9070,"props":9609,"children":9610},{},[9611],{"type":22,"value":9079},{"type":17,"tag":9070,"props":9613,"children":9614},{},[9615],{"type":22,"value":1348},{"type":17,"tag":9085,"props":9617,"children":9618},{},[9619,9635,9653,9688],{"type":17,"tag":9066,"props":9620,"children":9621},{},[9622,9627,9632],{"type":17,"tag":9092,"props":9623,"children":9624},{},[9625],{"type":22,"value":9626},"a* a+ a?",{"type":17,"tag":9092,"props":9628,"children":9629},{},[9630],{"type":22,"value":9631},"0 or more, 1 or more, 0 or 1",{"type":17,"tag":9092,"props":9633,"children":9634},{},[],{"type":17,"tag":9066,"props":9636,"children":9637},{},[9638,9643,9648],{"type":17,"tag":9092,"props":9639,"children":9640},{},[9641],{"type":22,"value":9642},"a{5} a{2,} a{1,3}",{"type":17,"tag":9092,"props":9644,"children":9645},{},[9646],{"type":22,"value":9647},"Matches the specified quantity.",{"type":17,"tag":9092,"props":9649,"children":9650},{},[9651],{"type":22,"value":9652},"Exactly five, two or more, between one & three",{"type":17,"tag":9066,"props":9654,"children":9655},{},[9656,9661,9666],{"type":17,"tag":9092,"props":9657,"children":9658},{},[9659],{"type":22,"value":9660},"a+? a{2,}?",{"type":17,"tag":9092,"props":9662,"children":9663},{},[9664],{"type":22,"value":9665},"? after *+?{} will match as few as possible.",{"type":17,"tag":9092,"props":9667,"children":9668},{},[9669,9671,9676,9677,9680,9682,9686],{"type":22,"value":9670},"/\\d+/ => ",{"type":17,"tag":9301,"props":9672,"children":9673},{},[9674],{"type":22,"value":9675},"123",{"type":22,"value":9450},{"type":17,"tag":9359,"props":9678,"children":9679},{},[],{"type":22,"value":9681}," /\\d+?/ => ",{"type":17,"tag":9301,"props":9683,"children":9684},{},[9685],{"type":22,"value":2868},{"type":22,"value":9687},"23",{"type":17,"tag":9066,"props":9689,"children":9690},{},[9691,9696,9701],{"type":17,"tag":9092,"props":9692,"children":9693},{},[9694],{"type":22,"value":9695},"ab|cd",{"type":17,"tag":9092,"props":9697,"children":9698},{},[9699],{"type":22,"value":9700},"Acts like a boolean OR.",{"type":17,"tag":9092,"props":9702,"children":9703},{},[9704],{"type":22,"value":9705},"match ab or cd",{"type":17,"tag":9359,"props":9707,"children":9708},{},[],{"type":17,"tag":24,"props":9710,"children":9712},{"id":9711},"flags",[9713],{"type":22,"value":9714},"Flags",{"type":17,"tag":18,"props":9716,"children":9717},{},[9718],{"type":22,"value":9719},"最後來介紹 flags，語法:",{"type":17,"tag":53,"props":9721,"children":9723},{"code":9722},"/pattern/flags\n",[9724],{"type":17,"tag":33,"props":9725,"children":9726},{"__ignoreMap":8},[9727],{"type":22,"value":9722},{"type":17,"tag":3151,"props":9729,"children":9730},{},[9731,9745],{"type":17,"tag":9062,"props":9732,"children":9733},{},[9734],{"type":17,"tag":9066,"props":9735,"children":9736},{},[9737,9741],{"type":17,"tag":9070,"props":9738,"children":9739},{},[9740],{"type":22,"value":9074},{"type":17,"tag":9070,"props":9742,"children":9743},{},[9744],{"type":22,"value":9079},{"type":17,"tag":9085,"props":9746,"children":9747},{},[9748,9761,9774,9786,9799],{"type":17,"tag":9066,"props":9749,"children":9750},{},[9751,9756],{"type":17,"tag":9092,"props":9752,"children":9753},{},[9754],{"type":22,"value":9755},"(nothing)",{"type":17,"tag":9092,"props":9757,"children":9758},{},[9759],{"type":22,"value":9760},"Return first matches.",{"type":17,"tag":9066,"props":9762,"children":9763},{},[9764,9769],{"type":17,"tag":9092,"props":9765,"children":9766},{},[9767],{"type":22,"value":9768},"g",{"type":17,"tag":9092,"props":9770,"children":9771},{},[9772],{"type":22,"value":9773},"Global search.",{"type":17,"tag":9066,"props":9775,"children":9776},{},[9777,9781],{"type":17,"tag":9092,"props":9778,"children":9779},{},[9780],{"type":22,"value":5379},{"type":17,"tag":9092,"props":9782,"children":9783},{},[9784],{"type":22,"value":9785},"Case-insensitive search.",{"type":17,"tag":9066,"props":9787,"children":9788},{},[9789,9794],{"type":17,"tag":9092,"props":9790,"children":9791},{},[9792],{"type":22,"value":9793},"m",{"type":17,"tag":9092,"props":9795,"children":9796},{},[9797],{"type":22,"value":9798},"Multi-line search.",{"type":17,"tag":9066,"props":9800,"children":9801},{},[9802,9807],{"type":17,"tag":9092,"props":9803,"children":9804},{},[9805],{"type":22,"value":9806},"u",{"type":17,"tag":9092,"props":9808,"children":9809},{},[9810],{"type":22,"value":9811},"Use unicode.",{"type":17,"tag":24,"props":9813,"children":9815},{"id":9814},"常用範例",[9816],{"type":22,"value":9814},{"type":17,"tag":5485,"props":9818,"children":9819},{},[9820],{"type":17,"tag":2640,"props":9821,"children":9822},{},[9823],{"type":22,"value":9824},"驗證為 youtube 連結",{"type":17,"tag":2636,"props":9826,"children":9827},{},[9828,9857],{"type":17,"tag":2640,"props":9829,"children":9830},{},[9831,9833,9839,9841,9847,9849,9855],{"type":22,"value":9832},"條件1: 需為 ",{"type":17,"tag":33,"props":9834,"children":9836},{"className":9835},[],[9837],{"type":22,"value":9838},"https://www.youtube.com/watch?",{"type":22,"value":9840}," 或 ",{"type":17,"tag":33,"props":9842,"children":9844},{"className":9843},[],[9845],{"type":22,"value":9846},"https://youtu.be/",{"type":22,"value":9848}," 開頭，前方",{"type":17,"tag":33,"props":9850,"children":9852},{"className":9851},[],[9853],{"type":22,"value":9854},"www",{"type":22,"value":9856},"可有可無",{"type":17,"tag":2640,"props":9858,"children":9859},{},[9860],{"type":22,"value":9861},"條件2: 後方需要至少一字元的任何值",{"type":17,"tag":53,"props":9863,"children":9865},{"code":9864},"/^https:\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/watch\\?).+$/g\n",[9866],{"type":17,"tag":33,"props":9867,"children":9868},{"__ignoreMap":8},[9869],{"type":22,"value":9864},{"type":17,"tag":5485,"props":9871,"children":9872},{"start":98},[9873],{"type":17,"tag":2640,"props":9874,"children":9875},{},[9876],{"type":22,"value":9877},"驗證密碼格式",{"type":17,"tag":2636,"props":9879,"children":9880},{},[9881,9886,9891,9896,9907],{"type":17,"tag":2640,"props":9882,"children":9883},{},[9884],{"type":22,"value":9885},"條件1: 長度8-16位",{"type":17,"tag":2640,"props":9887,"children":9888},{},[9889],{"type":22,"value":9890},"條件2: 至少需要一個數字及一個英文。數字：0 到 9(10個字元)；英文不限大小寫: A 到 Z, a 到 z)",{"type":17,"tag":2640,"props":9892,"children":9893},{},[9894],{"type":22,"value":9895},"條件3: 僅接受 數字/英文/特殊符號",{"type":17,"tag":2640,"props":9897,"children":9898},{},[9899,9901,9905],{"type":22,"value":9900},"條件4: 符號： !\" # $ % & ' ( ) * + , - . / : ; \u003C = > ? @ ",{"type":17,"tag":63,"props":9902,"children":9903},{},[9904],{"type":22,"value":307},{"type":22,"value":9906}," ^ _` { | } ~ (32個字元)",{"type":17,"tag":2640,"props":9908,"children":9909},{},[9910],{"type":22,"value":9911},"條件5: 不接受其他格式如空格及其他語言(中文/日文...等)",{"type":17,"tag":53,"props":9913,"children":9915},{"code":9914},"/^(?=.*[0-9])(?=.*[A-Z])([A-Z0-9\\w\\!\"#$%&\\'()*+,-.\\/:;\u003C=>?@[\\]^_`{|}~\\\\]){8,16}$/g\n",[9916],{"type":17,"tag":33,"props":9917,"children":9918},{"__ignoreMap":8},[9919],{"type":22,"value":9914},{"title":8,"searchDepth":98,"depth":98,"links":9921},[9922,9923,9924,9925,9926,9927,9928],{"id":9055,"depth":98,"text":9055},{"id":9239,"depth":98,"text":9239},{"id":9314,"depth":98,"text":9314},{"id":9387,"depth":98,"text":9387},{"id":9592,"depth":98,"text":9592},{"id":9711,"depth":98,"text":9714},{"id":9814,"depth":98,"text":9814},"content:article:coding:javascript-regular-expression.md","article/coding/javascript-regular-expression.md","article/coding/javascript-regular-expression",{"_path":9933,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9934,"description":9935,"category":6,"createdAt":9936,"updatedAt":9936,"body":9937,"_type":821,"_id":10543,"_source":823,"_file":10544,"_stem":10545,"_extension":826},"/article/coding/laravel-and-lumen-use-service-repository","在 Laravel/Lumen 使用 Service Repository 來分層設計架構","在 Laravel/Lumen 優雅的框架下，為使程式的耦合度降低、降低維護成本，也為了將程式模組化以方便管理與重複利用，而引進 Service 和 Repository 這兩個概念，功能分別為：","2022-07-14",{"type":14,"children":9938,"toc":10535},[9939,9960,9968,9986,9991,9996,10025,10084,10089,10099,10132,10137,10147,10210,10237,10243,10276,10280,10334,10339,10522,10526,10531],{"type":17,"tag":18,"props":9940,"children":9941},{},[9942,9944,9950,9952,9958],{"type":22,"value":9943},"在 Laravel/Lumen 優雅的框架下，為使程式的耦合度降低、降低維護成本，也為了將程式模組化以方便管理與重複利用，而引進 ",{"type":17,"tag":33,"props":9945,"children":9947},{"className":9946},[],[9948],{"type":22,"value":9949},"Service",{"type":22,"value":9951}," 和 ",{"type":17,"tag":33,"props":9953,"children":9955},{"className":9954},[],[9956],{"type":22,"value":9957},"Repository",{"type":22,"value":9959}," 這兩個概念，功能分別為：",{"type":17,"tag":53,"props":9961,"children":9963},{"code":9962},"Service: 只專注在商業邏輯\nRepository: 只專注於操作 Model \n",[9964],{"type":17,"tag":33,"props":9965,"children":9966},{"__ignoreMap":8},[9967],{"type":22,"value":9962},{"type":17,"tag":18,"props":9969,"children":9970},{},[9971,9973,9978,9979,9984],{"type":22,"value":9972},"以下教學如何在 Laravel/Lumen 使用 ",{"type":17,"tag":33,"props":9974,"children":9976},{"className":9975},[],[9977],{"type":22,"value":9949},{"type":22,"value":9951},{"type":17,"tag":33,"props":9980,"children":9982},{"className":9981},[],[9983],{"type":22,"value":9957},{"type":22,"value":9985}," 這兩個概念：",{"type":17,"tag":24,"props":9987,"children":9989},{"id":9988},"安裝套件",[9990],{"type":22,"value":9988},{"type":17,"tag":18,"props":9992,"children":9993},{},[9994],{"type":22,"value":9995},"在 command line 中下以下指令安裝",{"type":17,"tag":53,"props":9997,"children":9999},{"code":9998,"language":7388,"meta":8,"className":7389,"style":8},"$ composer require chhw/commander\n",[10000],{"type":17,"tag":33,"props":10001,"children":10002},{"__ignoreMap":8},[10003],{"type":17,"tag":63,"props":10004,"children":10005},{"class":65,"line":66},[10006,10010,10015,10020],{"type":17,"tag":63,"props":10007,"children":10008},{"style":182},[10009],{"type":22,"value":73},{"type":17,"tag":63,"props":10011,"children":10012},{"style":208},[10013],{"type":22,"value":10014}," composer",{"type":17,"tag":63,"props":10016,"children":10017},{"style":208},[10018],{"type":22,"value":10019}," require",{"type":17,"tag":63,"props":10021,"children":10022},{"style":208},[10023],{"type":22,"value":10024}," chhw/commander\n",{"type":17,"tag":2636,"props":10026,"children":10027},{},[10028,10033],{"type":17,"tag":2640,"props":10029,"children":10030},{},[10031],{"type":22,"value":10032},"使用 Laravel 框架基本上這樣就安裝完畢了，除非是 5.5 以下版本還要另外設定，就到官方套件查看說明。",{"type":17,"tag":2640,"props":10034,"children":10035},{},[10036,10038,10044,10046],{"type":22,"value":10037},"使用 Lumen 框架則要再 ",{"type":17,"tag":33,"props":10039,"children":10041},{"className":10040},[],[10042],{"type":22,"value":10043},"bootstrap/app.php",{"type":22,"value":10045}," 檔案做以下設定:\n",{"type":17,"tag":2636,"props":10047,"children":10048},{},[10049,10060,10071],{"type":17,"tag":2640,"props":10050,"children":10051},{},[10052,10054],{"type":22,"value":10053},"取消註解 ",{"type":17,"tag":33,"props":10055,"children":10057},{"className":10056},[],[10058],{"type":22,"value":10059},"$app->withEloquent();",{"type":17,"tag":2640,"props":10061,"children":10062},{},[10063,10065],{"type":22,"value":10064},"新增一行 ",{"type":17,"tag":33,"props":10066,"children":10068},{"className":10067},[],[10069],{"type":22,"value":10070},"$app->register(CHHW\\Commander\\CommanderServiceProvider::class);",{"type":17,"tag":2640,"props":10072,"children":10073},{},[10074,10076,10082],{"type":22,"value":10075},"另外再自行複製 Laravel 框架中的 ",{"type":17,"tag":33,"props":10077,"children":10079},{"className":10078},[],[10080],{"type":22,"value":10081},"config/database.php",{"type":22,"value":10083}," 放置相同目錄內",{"type":17,"tag":24,"props":10085,"children":10087},{"id":10086},"service",[10088],{"type":22,"value":9949},{"type":17,"tag":18,"props":10090,"children":10091},{},[10092,10094],{"type":22,"value":10093},"在 command line 中下以下指令即可創建 ",{"type":17,"tag":33,"props":10095,"children":10097},{"className":10096},[],[10098],{"type":22,"value":9949},{"type":17,"tag":53,"props":10100,"children":10102},{"code":10101,"language":7388,"meta":8,"className":7389,"style":8},"$ php artisan make:service UserService\n",[10103],{"type":17,"tag":33,"props":10104,"children":10105},{"__ignoreMap":8},[10106],{"type":17,"tag":63,"props":10107,"children":10108},{"class":65,"line":66},[10109,10113,10118,10122,10127],{"type":17,"tag":63,"props":10110,"children":10111},{"style":182},[10112],{"type":22,"value":73},{"type":17,"tag":63,"props":10114,"children":10115},{"style":208},[10116],{"type":22,"value":10117}," php",{"type":17,"tag":63,"props":10119,"children":10120},{"style":208},[10121],{"type":22,"value":7405},{"type":17,"tag":63,"props":10123,"children":10124},{"style":208},[10125],{"type":22,"value":10126}," make:service",{"type":17,"tag":63,"props":10128,"children":10129},{"style":208},[10130],{"type":22,"value":10131}," UserService\n",{"type":17,"tag":24,"props":10133,"children":10135},{"id":10134},"repository",[10136],{"type":22,"value":9957},{"type":17,"tag":18,"props":10138,"children":10139},{},[10140,10142],{"type":22,"value":10141},"在 command line 中下以下其中一個指令即可創建 ",{"type":17,"tag":33,"props":10143,"children":10145},{"className":10144},[],[10146],{"type":22,"value":9957},{"type":17,"tag":53,"props":10148,"children":10152},{"code":10149,"language":10150,"meta":8,"className":10151,"style":8},"$ php artisan make:repository UserRepository\n$ php artisan make:repository UserRepository --model=User\n","bash","language-bash shiki shiki-themes material-theme-palenight",[10153],{"type":17,"tag":33,"props":10154,"children":10155},{"__ignoreMap":8},[10156,10181],{"type":17,"tag":63,"props":10157,"children":10158},{"class":65,"line":66},[10159,10163,10167,10171,10176],{"type":17,"tag":63,"props":10160,"children":10161},{"style":182},[10162],{"type":22,"value":73},{"type":17,"tag":63,"props":10164,"children":10165},{"style":208},[10166],{"type":22,"value":10117},{"type":17,"tag":63,"props":10168,"children":10169},{"style":208},[10170],{"type":22,"value":7405},{"type":17,"tag":63,"props":10172,"children":10173},{"style":208},[10174],{"type":22,"value":10175}," make:repository",{"type":17,"tag":63,"props":10177,"children":10178},{"style":208},[10179],{"type":22,"value":10180}," UserRepository\n",{"type":17,"tag":63,"props":10182,"children":10183},{"class":65,"line":98},[10184,10188,10192,10196,10200,10205],{"type":17,"tag":63,"props":10185,"children":10186},{"style":182},[10187],{"type":22,"value":73},{"type":17,"tag":63,"props":10189,"children":10190},{"style":208},[10191],{"type":22,"value":10117},{"type":17,"tag":63,"props":10193,"children":10194},{"style":208},[10195],{"type":22,"value":7405},{"type":17,"tag":63,"props":10197,"children":10198},{"style":208},[10199],{"type":22,"value":10175},{"type":17,"tag":63,"props":10201,"children":10202},{"style":208},[10203],{"type":22,"value":10204}," UserRepository",{"type":17,"tag":63,"props":10206,"children":10207},{"style":208},[10208],{"type":22,"value":10209}," --model=User\n",{"type":17,"tag":18,"props":10211,"children":10212},{},[10213,10215,10221,10223,10228,10230,10235],{"type":22,"value":10214},"這兩個指令差別在於，下第二條指令可以在你已經有 ",{"type":17,"tag":33,"props":10216,"children":10218},{"className":10217},[],[10219],{"type":22,"value":10220},"Model",{"type":22,"value":10222},"，會在創建 ",{"type":17,"tag":33,"props":10224,"children":10226},{"className":10225},[],[10227],{"type":22,"value":9957},{"type":22,"value":10229}," 時綁定所指定的 ",{"type":17,"tag":33,"props":10231,"children":10233},{"className":10232},[],[10234],{"type":22,"value":10220},{"type":22,"value":10236}," (推薦使用)。",{"type":17,"tag":24,"props":10238,"children":10240},{"id":10239},"好用-methods",[10241],{"type":22,"value":10242},"好用 Methods",{"type":17,"tag":18,"props":10244,"children":10245},{},[10246,10248,10253,10255,10261,10262,10267,10268,10274],{"type":22,"value":10247},"套件中有提供一些好用的 methods 預設在 ",{"type":17,"tag":33,"props":10249,"children":10251},{"className":10250},[],[10252],{"type":22,"value":9957},{"type":22,"value":10254}," 中，像是可能會常用的 ",{"type":17,"tag":33,"props":10256,"children":10258},{"className":10257},[],[10259],{"type":22,"value":10260},"all",{"type":22,"value":40},{"type":17,"tag":33,"props":10263,"children":10265},{"className":10264},[],[10266],{"type":22,"value":1654},{"type":22,"value":40},{"type":17,"tag":33,"props":10269,"children":10271},{"className":10270},[],[10272],{"type":22,"value":10273},"paginate",{"type":22,"value":10275},"...等，其他可用的 methods 可以在官方套件中找到。",{"type":17,"tag":24,"props":10277,"children":10278},{"id":1348},[10279],{"type":22,"value":1348},{"type":17,"tag":18,"props":10281,"children":10282},{},[10283,10285,10290,10291,10296,10298,10303,10305,10310,10312,10317,10319,10325,10327,10332],{"type":22,"value":10284},"建立完 ",{"type":17,"tag":33,"props":10286,"children":10288},{"className":10287},[],[10289],{"type":22,"value":9949},{"type":22,"value":9951},{"type":17,"tag":33,"props":10292,"children":10294},{"className":10293},[],[10295],{"type":22,"value":9957},{"type":22,"value":10297}," 後，在 ",{"type":17,"tag":33,"props":10299,"children":10301},{"className":10300},[],[10302],{"type":22,"value":9949},{"type":22,"value":10304}," 中依賴注入 ",{"type":17,"tag":33,"props":10306,"children":10308},{"className":10307},[],[10309],{"type":22,"value":9957},{"type":22,"value":10311}," 後初始化，即可在 ",{"type":17,"tag":33,"props":10313,"children":10315},{"className":10314},[],[10316],{"type":22,"value":9949},{"type":22,"value":10318}," 中使用 ",{"type":17,"tag":33,"props":10320,"children":10322},{"className":10321},[],[10323],{"type":22,"value":10324},"$this->userRepository",{"type":22,"value":10326}," 來呼叫 ",{"type":17,"tag":33,"props":10328,"children":10330},{"className":10329},[],[10331],{"type":22,"value":9957},{"type":22,"value":10333}," 自定義 function 或如上所述套件提供的 methods。",{"type":17,"tag":18,"props":10335,"children":10336},{},[10337],{"type":22,"value":10338},"app/Services/UserService.php",{"type":17,"tag":53,"props":10340,"children":10342},{"code":10341,"language":57,"meta":8,"className":55,"style":8},"protected $userRepository;\n\npublic function __construct(UserRepository $repository)\n{\n    $this->userRepository = $repository;\n}\n\npublic function getAll()\n{\n    return $this->userRepository->all();\n}\n",[10343],{"type":17,"tag":33,"props":10344,"children":10345},{"__ignoreMap":8},[10346,10367,10374,10410,10417,10446,10453,10460,10480,10487,10515],{"type":17,"tag":63,"props":10347,"children":10348},{"class":65,"line":66},[10349,10354,10358,10363],{"type":17,"tag":63,"props":10350,"children":10351},{"style":2296},[10352],{"type":22,"value":10353},"protected",{"type":17,"tag":63,"props":10355,"children":10356},{"style":70},[10357],{"type":22,"value":152},{"type":17,"tag":63,"props":10359,"children":10360},{"style":76},[10361],{"type":22,"value":10362},"userRepository",{"type":17,"tag":63,"props":10364,"children":10365},{"style":70},[10366],{"type":22,"value":175},{"type":17,"tag":63,"props":10368,"children":10369},{"class":65,"line":98},[10370],{"type":17,"tag":63,"props":10371,"children":10372},{"emptyLinePlaceholder":1409},[10373],{"type":22,"value":1412},{"type":17,"tag":63,"props":10375,"children":10376},{"class":65,"line":108},[10377,10381,10385,10389,10393,10398,10402,10406],{"type":17,"tag":63,"props":10378,"children":10379},{"style":2296},[10380],{"type":22,"value":2413},{"type":17,"tag":63,"props":10382,"children":10383},{"style":2296},[10384],{"type":22,"value":2418},{"type":17,"tag":63,"props":10386,"children":10387},{"style":87},[10388],{"type":22,"value":3698},{"type":17,"tag":63,"props":10390,"children":10391},{"style":70},[10392],{"type":22,"value":200},{"type":17,"tag":63,"props":10394,"children":10395},{"style":182},[10396],{"type":22,"value":10397},"UserRepository",{"type":17,"tag":63,"props":10399,"children":10400},{"style":70},[10401],{"type":22,"value":152},{"type":17,"tag":63,"props":10403,"children":10404},{"style":76},[10405],{"type":22,"value":10134},{"type":17,"tag":63,"props":10407,"children":10408},{"style":70},[10409],{"type":22,"value":347},{"type":17,"tag":63,"props":10411,"children":10412},{"class":65,"line":133},[10413],{"type":17,"tag":63,"props":10414,"children":10415},{"style":70},[10416],{"type":22,"value":2453},{"type":17,"tag":63,"props":10418,"children":10419},{"class":65,"line":178},[10420,10425,10430,10434,10438,10442],{"type":17,"tag":63,"props":10421,"children":10422},{"style":70},[10423],{"type":22,"value":10424},"    $this->",{"type":17,"tag":63,"props":10426,"children":10427},{"style":76},[10428],{"type":22,"value":10429},"userRepository ",{"type":17,"tag":63,"props":10431,"children":10432},{"style":70},[10433],{"type":22,"value":84},{"type":17,"tag":63,"props":10435,"children":10436},{"style":70},[10437],{"type":22,"value":152},{"type":17,"tag":63,"props":10439,"children":10440},{"style":76},[10441],{"type":22,"value":10134},{"type":17,"tag":63,"props":10443,"children":10444},{"style":70},[10445],{"type":22,"value":175},{"type":17,"tag":63,"props":10447,"children":10448},{"class":65,"line":474},[10449],{"type":17,"tag":63,"props":10450,"children":10451},{"style":70},[10452],{"type":22,"value":2088},{"type":17,"tag":63,"props":10454,"children":10455},{"class":65,"line":499},[10456],{"type":17,"tag":63,"props":10457,"children":10458},{"emptyLinePlaceholder":1409},[10459],{"type":22,"value":1412},{"type":17,"tag":63,"props":10461,"children":10462},{"class":65,"line":584},[10463,10467,10471,10476],{"type":17,"tag":63,"props":10464,"children":10465},{"style":2296},[10466],{"type":22,"value":2413},{"type":17,"tag":63,"props":10468,"children":10469},{"style":2296},[10470],{"type":22,"value":2418},{"type":17,"tag":63,"props":10472,"children":10473},{"style":87},[10474],{"type":22,"value":10475}," getAll",{"type":17,"tag":63,"props":10477,"children":10478},{"style":70},[10479],{"type":22,"value":3703},{"type":17,"tag":63,"props":10481,"children":10482},{"class":65,"line":731},[10483],{"type":17,"tag":63,"props":10484,"children":10485},{"style":70},[10486],{"type":22,"value":2453},{"type":17,"tag":63,"props":10488,"children":10489},{"class":65,"line":1754},[10490,10494,10499,10503,10507,10511],{"type":17,"tag":63,"props":10491,"children":10492},{"style":1418},[10493],{"type":22,"value":2580},{"type":17,"tag":63,"props":10495,"children":10496},{"style":70},[10497],{"type":22,"value":10498}," $this->",{"type":17,"tag":63,"props":10500,"children":10501},{"style":76},[10502],{"type":22,"value":10362},{"type":17,"tag":63,"props":10504,"children":10505},{"style":70},[10506],{"type":22,"value":1774},{"type":17,"tag":63,"props":10508,"children":10509},{"style":87},[10510],{"type":22,"value":10260},{"type":17,"tag":63,"props":10512,"children":10513},{"style":70},[10514],{"type":22,"value":279},{"type":17,"tag":63,"props":10516,"children":10517},{"class":65,"line":1799},[10518],{"type":17,"tag":63,"props":10519,"children":10520},{"style":70},[10521],{"type":22,"value":2088},{"type":17,"tag":24,"props":10523,"children":10524},{"id":7267},[10525],{"type":22,"value":7267},{"type":17,"tag":18,"props":10527,"children":10528},{},[10529],{"type":22,"value":10530},"如果善用這兩個功能，你在開發上會容易許多，多人合作開發也較易拆分功能，程式也會跟框架一樣很優雅，別人之後維護這樣相同模式的開發也會容易許多。或許你會說，為什麼離職後還要考慮別人維護我 code 容不容易呢? 我相信你跳槽之後絕對不想碰別人的爛 code，所以，己所不欲勿施於人呀~",{"type":17,"tag":810,"props":10532,"children":10533},{},[10534],{"type":22,"value":814},{"title":8,"searchDepth":98,"depth":98,"links":10536},[10537,10538,10539,10540,10541,10542],{"id":9988,"depth":98,"text":9988},{"id":10086,"depth":98,"text":9949},{"id":10134,"depth":98,"text":9957},{"id":10239,"depth":98,"text":10242},{"id":1348,"depth":98,"text":1348},{"id":7267,"depth":98,"text":7267},"content:article:coding:laravel-and-lumen-use-service-repository.md","article/coding/laravel-and-lumen-use-service-repository.md","article/coding/laravel-and-lumen-use-service-repository",{"_path":10547,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":10548,"description":10549,"category":6,"createdAt":10550,"updatedAt":10550,"body":10551,"_type":821,"_id":11109,"_source":823,"_file":11110,"_stem":11111,"_extension":826},"/article/coding/php-docker-image-install-extension","使用 PHP Docker image 安裝 PHP 擴展","以下介紹使用 PHP Docker image 安裝 PHP 擴展的方式，以及可以使用此方法安裝的擴展：","2022-07-05",{"type":14,"children":10552,"toc":11105},[10553,10557,10562,10567,11095,11100],{"type":17,"tag":18,"props":10554,"children":10555},{},[10556],{"type":22,"value":10549},{"type":17,"tag":24,"props":10558,"children":10560},{"id":10559},"docker-php-ext-install",[10561],{"type":22,"value":10559},{"type":17,"tag":18,"props":10563,"children":10564},{},[10565],{"type":22,"value":10566},"安裝並自動調用 docker-php-ext-enable 來啟動 PHP 擴展",{"type":17,"tag":3151,"props":10568,"children":10569},{},[10570,10581],{"type":17,"tag":9062,"props":10571,"children":10572},{},[10573],{"type":17,"tag":9066,"props":10574,"children":10575},{},[10576],{"type":17,"tag":9070,"props":10577,"children":10578},{},[10579],{"type":22,"value":10580},"可使用擴展",{"type":17,"tag":9085,"props":10582,"children":10583},{},[10584,10592,10600,10608,10616,10624,10632,10640,10648,10656,10664,10672,10680,10688,10696,10704,10712,10720,10728,10736,10744,10752,10760,10768,10776,10784,10792,10800,10808,10816,10824,10832,10840,10848,10856,10864,10872,10880,10888,10896,10904,10912,10920,10928,10936,10944,10952,10960,10968,10976,10983,10991,10999,11007,11015,11023,11031,11039,11047,11055,11063,11071,11079,11087],{"type":17,"tag":9066,"props":10585,"children":10586},{},[10587],{"type":17,"tag":9092,"props":10588,"children":10589},{},[10590],{"type":22,"value":10591},"bcmath",{"type":17,"tag":9066,"props":10593,"children":10594},{},[10595],{"type":17,"tag":9092,"props":10596,"children":10597},{},[10598],{"type":22,"value":10599},"bz2",{"type":17,"tag":9066,"props":10601,"children":10602},{},[10603],{"type":17,"tag":9092,"props":10604,"children":10605},{},[10606],{"type":22,"value":10607},"calendar",{"type":17,"tag":9066,"props":10609,"children":10610},{},[10611],{"type":17,"tag":9092,"props":10612,"children":10613},{},[10614],{"type":22,"value":10615},"ctype",{"type":17,"tag":9066,"props":10617,"children":10618},{},[10619],{"type":17,"tag":9092,"props":10620,"children":10621},{},[10622],{"type":22,"value":10623},"curl",{"type":17,"tag":9066,"props":10625,"children":10626},{},[10627],{"type":17,"tag":9092,"props":10628,"children":10629},{},[10630],{"type":22,"value":10631},"dba",{"type":17,"tag":9066,"props":10633,"children":10634},{},[10635],{"type":17,"tag":9092,"props":10636,"children":10637},{},[10638],{"type":22,"value":10639},"dom",{"type":17,"tag":9066,"props":10641,"children":10642},{},[10643],{"type":17,"tag":9092,"props":10644,"children":10645},{},[10646],{"type":22,"value":10647},"enchant",{"type":17,"tag":9066,"props":10649,"children":10650},{},[10651],{"type":17,"tag":9092,"props":10652,"children":10653},{},[10654],{"type":22,"value":10655},"exif",{"type":17,"tag":9066,"props":10657,"children":10658},{},[10659],{"type":17,"tag":9092,"props":10660,"children":10661},{},[10662],{"type":22,"value":10663},"fileinfo",{"type":17,"tag":9066,"props":10665,"children":10666},{},[10667],{"type":17,"tag":9092,"props":10668,"children":10669},{},[10670],{"type":22,"value":10671},"filter",{"type":17,"tag":9066,"props":10673,"children":10674},{},[10675],{"type":17,"tag":9092,"props":10676,"children":10677},{},[10678],{"type":22,"value":10679},"ftp",{"type":17,"tag":9066,"props":10681,"children":10682},{},[10683],{"type":17,"tag":9092,"props":10684,"children":10685},{},[10686],{"type":22,"value":10687},"gd",{"type":17,"tag":9066,"props":10689,"children":10690},{},[10691],{"type":17,"tag":9092,"props":10692,"children":10693},{},[10694],{"type":22,"value":10695},"gettext",{"type":17,"tag":9066,"props":10697,"children":10698},{},[10699],{"type":17,"tag":9092,"props":10700,"children":10701},{},[10702],{"type":22,"value":10703},"gmp",{"type":17,"tag":9066,"props":10705,"children":10706},{},[10707],{"type":17,"tag":9092,"props":10708,"children":10709},{},[10710],{"type":22,"value":10711},"hash",{"type":17,"tag":9066,"props":10713,"children":10714},{},[10715],{"type":17,"tag":9092,"props":10716,"children":10717},{},[10718],{"type":22,"value":10719},"iconv",{"type":17,"tag":9066,"props":10721,"children":10722},{},[10723],{"type":17,"tag":9092,"props":10724,"children":10725},{},[10726],{"type":22,"value":10727},"imap",{"type":17,"tag":9066,"props":10729,"children":10730},{},[10731],{"type":17,"tag":9092,"props":10732,"children":10733},{},[10734],{"type":22,"value":10735},"interbase",{"type":17,"tag":9066,"props":10737,"children":10738},{},[10739],{"type":17,"tag":9092,"props":10740,"children":10741},{},[10742],{"type":22,"value":10743},"intl",{"type":17,"tag":9066,"props":10745,"children":10746},{},[10747],{"type":17,"tag":9092,"props":10748,"children":10749},{},[10750],{"type":22,"value":10751},"json",{"type":17,"tag":9066,"props":10753,"children":10754},{},[10755],{"type":17,"tag":9092,"props":10756,"children":10757},{},[10758],{"type":22,"value":10759},"ldap",{"type":17,"tag":9066,"props":10761,"children":10762},{},[10763],{"type":17,"tag":9092,"props":10764,"children":10765},{},[10766],{"type":22,"value":10767},"mbstring",{"type":17,"tag":9066,"props":10769,"children":10770},{},[10771],{"type":17,"tag":9092,"props":10772,"children":10773},{},[10774],{"type":22,"value":10775},"mcrypt",{"type":17,"tag":9066,"props":10777,"children":10778},{},[10779],{"type":17,"tag":9092,"props":10780,"children":10781},{},[10782],{"type":22,"value":10783},"mysqli",{"type":17,"tag":9066,"props":10785,"children":10786},{},[10787],{"type":17,"tag":9092,"props":10788,"children":10789},{},[10790],{"type":22,"value":10791},"oci8",{"type":17,"tag":9066,"props":10793,"children":10794},{},[10795],{"type":17,"tag":9092,"props":10796,"children":10797},{},[10798],{"type":22,"value":10799},"odbc",{"type":17,"tag":9066,"props":10801,"children":10802},{},[10803],{"type":17,"tag":9092,"props":10804,"children":10805},{},[10806],{"type":22,"value":10807},"opcache",{"type":17,"tag":9066,"props":10809,"children":10810},{},[10811],{"type":17,"tag":9092,"props":10812,"children":10813},{},[10814],{"type":22,"value":10815},"pcntl",{"type":17,"tag":9066,"props":10817,"children":10818},{},[10819],{"type":17,"tag":9092,"props":10820,"children":10821},{},[10822],{"type":22,"value":10823},"pdo",{"type":17,"tag":9066,"props":10825,"children":10826},{},[10827],{"type":17,"tag":9092,"props":10828,"children":10829},{},[10830],{"type":22,"value":10831},"pdo_dblib",{"type":17,"tag":9066,"props":10833,"children":10834},{},[10835],{"type":17,"tag":9092,"props":10836,"children":10837},{},[10838],{"type":22,"value":10839},"pdo_firebird",{"type":17,"tag":9066,"props":10841,"children":10842},{},[10843],{"type":17,"tag":9092,"props":10844,"children":10845},{},[10846],{"type":22,"value":10847},"pdo_mysql",{"type":17,"tag":9066,"props":10849,"children":10850},{},[10851],{"type":17,"tag":9092,"props":10852,"children":10853},{},[10854],{"type":22,"value":10855},"pdo_oci",{"type":17,"tag":9066,"props":10857,"children":10858},{},[10859],{"type":17,"tag":9092,"props":10860,"children":10861},{},[10862],{"type":22,"value":10863},"pdo_odbc",{"type":17,"tag":9066,"props":10865,"children":10866},{},[10867],{"type":17,"tag":9092,"props":10868,"children":10869},{},[10870],{"type":22,"value":10871},"pdo_pgsql",{"type":17,"tag":9066,"props":10873,"children":10874},{},[10875],{"type":17,"tag":9092,"props":10876,"children":10877},{},[10878],{"type":22,"value":10879},"pdo_sqlite",{"type":17,"tag":9066,"props":10881,"children":10882},{},[10883],{"type":17,"tag":9092,"props":10884,"children":10885},{},[10886],{"type":22,"value":10887},"pgsql",{"type":17,"tag":9066,"props":10889,"children":10890},{},[10891],{"type":17,"tag":9092,"props":10892,"children":10893},{},[10894],{"type":22,"value":10895},"phar",{"type":17,"tag":9066,"props":10897,"children":10898},{},[10899],{"type":17,"tag":9092,"props":10900,"children":10901},{},[10902],{"type":22,"value":10903},"posix",{"type":17,"tag":9066,"props":10905,"children":10906},{},[10907],{"type":17,"tag":9092,"props":10908,"children":10909},{},[10910],{"type":22,"value":10911},"pspell",{"type":17,"tag":9066,"props":10913,"children":10914},{},[10915],{"type":17,"tag":9092,"props":10916,"children":10917},{},[10918],{"type":22,"value":10919},"readline",{"type":17,"tag":9066,"props":10921,"children":10922},{},[10923],{"type":17,"tag":9092,"props":10924,"children":10925},{},[10926],{"type":22,"value":10927},"recode",{"type":17,"tag":9066,"props":10929,"children":10930},{},[10931],{"type":17,"tag":9092,"props":10932,"children":10933},{},[10934],{"type":22,"value":10935},"reflection",{"type":17,"tag":9066,"props":10937,"children":10938},{},[10939],{"type":17,"tag":9092,"props":10940,"children":10941},{},[10942],{"type":22,"value":10943},"session",{"type":17,"tag":9066,"props":10945,"children":10946},{},[10947],{"type":17,"tag":9092,"props":10948,"children":10949},{},[10950],{"type":22,"value":10951},"shmop",{"type":17,"tag":9066,"props":10953,"children":10954},{},[10955],{"type":17,"tag":9092,"props":10956,"children":10957},{},[10958],{"type":22,"value":10959},"simplexml",{"type":17,"tag":9066,"props":10961,"children":10962},{},[10963],{"type":17,"tag":9092,"props":10964,"children":10965},{},[10966],{"type":22,"value":10967},"snmp",{"type":17,"tag":9066,"props":10969,"children":10970},{},[10971],{"type":17,"tag":9092,"props":10972,"children":10973},{},[10974],{"type":22,"value":10975},"soap",{"type":17,"tag":9066,"props":10977,"children":10978},{},[10979],{"type":17,"tag":9092,"props":10980,"children":10981},{},[10982],{"type":22,"value":7320},{"type":17,"tag":9066,"props":10984,"children":10985},{},[10986],{"type":17,"tag":9092,"props":10987,"children":10988},{},[10989],{"type":22,"value":10990},"spl",{"type":17,"tag":9066,"props":10992,"children":10993},{},[10994],{"type":17,"tag":9092,"props":10995,"children":10996},{},[10997],{"type":22,"value":10998},"standard",{"type":17,"tag":9066,"props":11000,"children":11001},{},[11002],{"type":17,"tag":9092,"props":11003,"children":11004},{},[11005],{"type":22,"value":11006},"sysvmsg",{"type":17,"tag":9066,"props":11008,"children":11009},{},[11010],{"type":17,"tag":9092,"props":11011,"children":11012},{},[11013],{"type":22,"value":11014},"sysvsem",{"type":17,"tag":9066,"props":11016,"children":11017},{},[11018],{"type":17,"tag":9092,"props":11019,"children":11020},{},[11021],{"type":22,"value":11022},"sysvshm",{"type":17,"tag":9066,"props":11024,"children":11025},{},[11026],{"type":17,"tag":9092,"props":11027,"children":11028},{},[11029],{"type":22,"value":11030},"tidy",{"type":17,"tag":9066,"props":11032,"children":11033},{},[11034],{"type":17,"tag":9092,"props":11035,"children":11036},{},[11037],{"type":22,"value":11038},"tokenizer",{"type":17,"tag":9066,"props":11040,"children":11041},{},[11042],{"type":17,"tag":9092,"props":11043,"children":11044},{},[11045],{"type":22,"value":11046},"wddx",{"type":17,"tag":9066,"props":11048,"children":11049},{},[11050],{"type":17,"tag":9092,"props":11051,"children":11052},{},[11053],{"type":22,"value":11054},"xml",{"type":17,"tag":9066,"props":11056,"children":11057},{},[11058],{"type":17,"tag":9092,"props":11059,"children":11060},{},[11061],{"type":22,"value":11062},"xmlreader",{"type":17,"tag":9066,"props":11064,"children":11065},{},[11066],{"type":17,"tag":9092,"props":11067,"children":11068},{},[11069],{"type":22,"value":11070},"xmlrpc",{"type":17,"tag":9066,"props":11072,"children":11073},{},[11074],{"type":17,"tag":9092,"props":11075,"children":11076},{},[11077],{"type":22,"value":11078},"xmlwriter",{"type":17,"tag":9066,"props":11080,"children":11081},{},[11082],{"type":17,"tag":9092,"props":11083,"children":11084},{},[11085],{"type":22,"value":11086},"xsl",{"type":17,"tag":9066,"props":11088,"children":11089},{},[11090],{"type":17,"tag":9092,"props":11091,"children":11092},{},[11093],{"type":22,"value":11094},"zip",{"type":17,"tag":24,"props":11096,"children":11098},{"id":11097},"docker-php-ext-enable",[11099],{"type":22,"value":11097},{"type":17,"tag":18,"props":11101,"children":11102},{},[11103],{"type":22,"value":11104},"使用 pecl 安裝 PHP 擴展時默認是沒有啟動這個擴展，此指令則是自動幫我們來啟動 PHP 擴展，而不需手動去 php.ini 裡啟動。",{"title":8,"searchDepth":98,"depth":98,"links":11106},[11107,11108],{"id":10559,"depth":98,"text":10559},{"id":11097,"depth":98,"text":11097},"content:article:coding:php-docker-image-install-extension.md","article/coding/php-docker-image-install-extension.md","article/coding/php-docker-image-install-extension",[11113],{"title":11114,"_path":11115,"children":11116},"Article","/article",[11117,11127,11150,11166],{"title":11118,"_path":11119,"children":11120},"Casual","/article/casual",[11121,11124],{"title":11122,"_path":11123},"消防安全相關知識","/article/casual/knowledge-of-fire-safety",{"title":11125,"_path":11126},"謝謝之前在電梯裡幫助過我的那位陌生人","/article/casual/thank-you-stranger-in-the-elevator",{"title":11128,"_path":11129,"children":11130},"Coding","/article/coding",[11131,11132,11133,11134,11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149],{"title":829,"_path":828},{"title":6952,"_path":6951},{"title":5458,"_path":5457},{"title":2364,"_path":2363},{"title":2626,"_path":2625},{"title":9043,"_path":9042},{"title":9934,"_path":9933},{"title":8879,"_path":8878},{"title":10548,"_path":10547},{"title":7247,"_path":7246},{"title":7299,"_path":7522},{"title":7283,"_path":7282},{"title":6736,"_path":6735},{"title":5661,"_path":5660},{"title":3102,"_path":3101},{"title":9,"_path":5},{"title":4690,"_path":4689},{"title":6654,"_path":6653},{"title":5329,"_path":5328},{"title":11151,"_path":11152,"children":11153},"Drama","/article/drama",[11154,11157,11160,11163],{"title":11155,"_path":11156},"《小小兵2：格魯的崛起》2022 年暑假歡樂登場！","/article/drama/2022-movie-minions-the-rise-of-gru",{"title":11158,"_path":11159},"《冰與火之歌：權力遊戲》全八季觀後感","/article/drama/review-of-game-of-thrones",{"title":11161,"_path":11162},"《蒼蘭訣》觀後感","/article/drama/review-of-love-between-fairy-and-devil",{"title":11164,"_path":11165},"陸劇《斛珠夫人》觀後感","/article/drama/review-of-novoland-pearl-eclipse",{"title":11167,"_path":11168,"children":11169},"Server","/article/server",[11170,11173,11176,11179],{"title":11171,"_path":11172},"2023 DevOps 學習路線圖","/article/server/2023-the-devops-burger",{"title":11174,"_path":11175},"Alpine Linux 包管理工具指令用法與手動安裝特定版本套件","/article/server/alpine-apk-command-and-manual-install-specific-version-of-package",{"title":11177,"_path":11178},"Linux 常用指令","/article/server/linux-common-command",{"title":11180,"_path":11181},"Linux 處理壓縮檔案","/article/server/linux-handle-compressed-archive",1766375576372]