- Aug 13 Tue 2019 15:30
-
[PHP][轉] object轉換成array - Convert PHP object to associative array
- Aug 13 Tue 2019 11:51
-
[轉][Laravel] Laravel: Check if record exists Before Insertion
Q: 如何在Laravel insert資料前先檢查此資料是否已存在DB中?
A: 先使用where條件加上count()去檢查資料是否存在。
若count>0代表存在,count==0代表不存在。
--
A: 先使用where條件加上count()去檢查資料是否存在。
若count>0代表存在,count==0代表不存在。
--
- Aug 13 Tue 2019 11:41
-
[轉][Laravel] How do I catch a query exception in laravel to see if it fails?
Q: 如何在laravel中去catach DB query的exception
A:
程式開頭要use Illuminate\Database\QueryException;
在catch中使用Illuminate\Database\QueryException,此時dd出來的message就是詳細的錯誤內容
A:
程式開頭要use Illuminate\Database\QueryException;
在catch中使用Illuminate\Database\QueryException,此時dd出來的message就是詳細的錯誤內容
- Aug 12 Mon 2019 16:58
-
[Laravel][轉] DB查詢產生器
- Aug 12 Mon 2019 15:28
-
[Laravel] 執行 php artisan migrate時,出現Class 'xxxxxxxxx' not found的錯誤
Q: 執行 php artisan migrate時,出現Class 'xxxxxxxxx' not found的錯誤
A: 發現是migration的php檔案的檔名格式要符合laravel migration的規定,才不會出錯:
YYYY_MM_DD_HHIISS_create_class名稱.php
A: 發現是migration的php檔案的檔名格式要符合laravel migration的規定,才不會出錯:
YYYY_MM_DD_HHIISS_create_class名稱.php
- Aug 07 Wed 2019 12:03
-
[轉][Laravel] schema builder laravel migrations unique on two columns
Q: 如何在laravel migrations中設定兩個欄位組合為unique
A: 使用陣列把兩個欄位包起來傳進去
The second param is to manually set the name of the unique index. Use an array as the first param to create a unique key across multiple columns.
A: 使用陣列把兩個欄位包起來傳進去
The second param is to manually set the name of the unique index. Use an array as the first param to create a unique key across multiple columns.
- Aug 07 Wed 2019 11:55
-
[轉][Laravel] Laravel schema 結構生成器
- Aug 07 Wed 2019 10:15
-
[轉] 木桐讀書會 日本B級小都怎麼玩?
- Aug 05 Mon 2019 14:10
-
[轉] NetLimiter 4,限制應用程式上傳/下載速度
- Aug 05 Mon 2019 11:47
-
[life] 台新 優質薪轉儲蓄存款
- Aug 02 Fri 2019 16:29
-
[RN][轉] React入門0x008: 生命週期

最近在寫react native,一直碰到"Warning: Can't call setState on a component that is not yet mounted."這個warning
實在搞不懂怎麼解決,直到找到這篇文章,明白說明react程式甚麼時候會執行甚麼function。
簡單說,在constructor只能定義state,並給初始值,但不能setState
- Aug 01 Thu 2019 11:30
-
[Javascript] arrow function中的this
昨天使用button onPress屬性呼叫function test做別的事
onPress={this.test}
一開始function test是寫成一般呼叫形式,function test(){ ... }
然後function test裏頭用到別的function都會使用this.加上function name,this.otherfunction();
onPress={this.test}
一開始function test是寫成一般呼叫形式,function test(){ ... }
然後function test裏頭用到別的function都會使用this.加上function name,this.otherfunction();

