都 2018 年了, MySQL 資料庫字元編碼請使用 utf8mb4,原因是從來沒有一個時代,能夠從手機如此容易輸入 emoji 表情符號。若是新開的案子就直接使用 utf8mb4 當作字元
read more假設兩個 Model : A, B, 一對一關係,例如 A has B, B belongs A,當要撈出 A 中有 B 且符合 在 B 的篩選欄位條件。A 是 Post 貼文, B 是 Comment 評論,A 和 B 的更新日期時間欄位都是
read moreImportant: The result of 10/110 in SQLite is 0 and different with 0.09090909 when manipulating in MySQL. When testing Laravel Eloquent ORM both at local machine with SQLite and at remote machine with MySQL, you will find some execution results don’t same as expected at local machine. That’s is because SQLite won’t transform integer to real number automatically. Workaround: Add multiply 1.0 to ORM SQL statement and it becomes portable
read moreRefer from link: http://laragems.com/post/a-quick-way-to-display-a-sql-query-in-tinker Please enter tinker command: php artisan tinker Type below code: DB::listen(function ($query) { dump($query->sql); dump($query->bindings); dump($query->time); }); And from above line on, every ORM manipulation you type will show what transformed SQL is.
read moreVersion: Laravel 5.5 Model: Post, Comment Post’s columns: id, title, content, created_at, updated_at Comment’s columns: id, post_id, content, c_date, c_time, u_date, u_time Relation: A post has many comments and a comment belongs to a post. The following shows how to get posts, which had been comments in recent 24 hours. use CarbonCarbon; // use package Post::whereHas('comments', function ($query) { $query->whereRaw('(u_date = ? AND u_time >= ?) OR (u_date =? AND
read more看過長榮航空 2016 和 2017 年財務年報 看過 udemy android app 開發課 https://www.udemy.com/master-android-7-nougat-java-app-development-step-by-step/ database 資料庫相關章節的第 166~248 節 . 20180630 補充:已經看完第 249-263 節. 基礎課程的 introduction , downloading and setup, helloworld app, button-counter app. 看完 Youtuber hvass 機器學習
read more