<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8432704824884642955</id><updated>2024-09-06T04:57:21.840+08:00</updated><category term="Linux"/><category term="PHP"/><category term="好用模組"/><category term="LAMP"/><category term="jQuery"/><category term="程式設計師的修練"/><category term="javaScript"/><category term="網管工具"/><category term="CodeIgniter"/><category term="css"/><category term="facebook"/><category term="ubuntu"/><category term="mysql"/><category term="UTF-8"/><category term="CodeIgniter4"/><category term="Laravel"/><category term="MongoDB"/><category term="google API"/><category term="中文亂碼"/><category term="Android"/><category term="CI4"/><category term="YUM"/><category term="database"/><category term="google"/><category term="丟掉 windows"/><category term="firebase"/><category term="物件"/><category term="索引"/><category term="AWS"/><category term="Centos"/><category term="Certbot"/><category term="PostgreSQL"/><category term="S3"/><category term="Service"/><category term="Vue.js"/><category term="WordPress"/><category term="api"/><category term="csv"/><category term="email"/><category term="fullCalender"/><category term="https"/><category term="json"/><category term="前端"/><category term="工商服務"/><category term="自定義函式庫"/><category term="陣列處理"/><title type='text'>小灰狼php筆記</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>152</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-6823156437605397658</id><published>2022-03-03T16:11:00.002+08:00</published><updated>2022-03-03T16:11:55.944+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CI4"/><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter4"/><title type='text'>CodeIngiter 4 動態網址設定成 base_url 參數 ngrok 適用</title><summary type="text">在 CodeIgniter 4 baseURL 這個變數的設定是非常重要的。如果是單一環境使用，我們可以寫在 app/Config/App.php&amp;nbsp;中就好。若是多環境通常我們會在每個環境中的 .env 檔進行宣告。但是～～如果網址是一直變得呢？例如我們在開發和測試的過程用到 ngrok 這種每次啟動就會給你換一次網址的，就需要用下面的作法。首先，我們先將 app/Config/App.php 中的&amp;nbsp;public $baseURL 設定成public $baseURL = BASE ;接著在另一個檔案。app/Config/Constants.php 中加入：$protocol = isset($_SERVER[&#39;HTTPS&#39;]) &amp;amp;&amp;amp; $_SERVER[&#39;HTTPS&#39;] != &#39;off&#39; ? &#39;https://&#39;.$_SERVER[&#39;HTTP_HOST</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/6823156437605397658/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/6823156437605397658' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6823156437605397658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6823156437605397658'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2022/03/codeingiter-4-baseurl-ngrok.html' title='CodeIngiter 4 動態網址設定成 base_url 參數 ngrok 適用'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-4449911276027100363</id><published>2021-10-07T12:16:00.004+08:00</published><updated>2021-10-07T12:16:33.154+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CI4"/><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter4"/><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>Docker 上直接快速部屬 CodeIgniter4 Mysql 環境</title><summary type="text">&amp;nbsp;一般來說我們要建構一個給 CodeIgniter4 使用的 Docker 時，一次會抓取多個 Dockerfile 來同時運作 php 和 mysql 的服務。這樣子其實滿麻煩的，同時又非常占空間。一個官方的 docker image 就會用到 500MB 以上。如果對環境沒有特別要求只是要趕快弄個伺服器來跑開發，可以試試看這個https://github.com/gwolf0719/CodeIgniter4_Docker_php_mysql我稍微做了一下整理，最主要就是要跳過肥大的 ubuntu 改用 Alpine 。反正只是開發環境，我們不會用到那麼複雜的東西的前提下這個還是挺好用的操作原理很簡單。只要把這個 git clone 下來。打包-&amp;gt;啟動。打包成 www 後如果有 docker Desktop 可以看一下接著啟動這個 image我就會把伺服器環境（LNMP</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/4449911276027100363/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/4449911276027100363' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/4449911276027100363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/4449911276027100363'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2021/10/docker-codeigniter4-mysql.html' title='Docker 上直接快速部屬 CodeIgniter4 Mysql 環境'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicEfGnx8hxkxtFwH9ItYwmIW8rxVtt4SX7ZUzcy2b8EvyyVj42s24zdzIkqZWBQH5Z2Zm0FnE8RxPoQIbCUH_5-WN80JivrHxXElB60FatYxP2fBkm7NWcO4oSJIlH0NyoGnnUHEAxjBTL/s72-c/%25E6%2588%25AA%25E5%259C%2596+2021-10-07+%25E4%25B8%258B%25E5%258D%258812.07.24.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-1239404356265903134</id><published>2021-05-25T15:05:00.001+08:00</published><updated>2021-05-25T15:05:07.275+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>線上頭像產生器</title><summary type="text">我們在開發網站的時候需要一些看起來像真的的假資料，有些時候甚至需要每個會員的大頭照。這個站可以幫上一點忙。&amp;nbsp;https://multiavatar.com/他可以線上亂數產生出一張又一張的大頭貼，你可以選擇下載或是直接拿線上連結都可以。這樣我們要產生多少的會員資料都不是難事了！</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/1239404356265903134/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/1239404356265903134' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/1239404356265903134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/1239404356265903134'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2021/05/blog-post.html' title='線上頭像產生器'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjonv0QudQp1q4Uy6JqUkJkVHv-UWxIODK3KK-AuvriDapC_2aN68_AwjA72f_0C2EYVwH6yFHozkJymIum-dkySNwW57Blco7WrRsnMWxY-8yhVMrRIWVFkKA8cLJ0xIt2UhVEM6fFeOzG/s72-w640-h384-c/%25E6%2588%25AA%25E5%259C%2596+2021-05-25+%25E4%25B8%258B%25E5%258D%25883.02.09.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-6809599149382047466</id><published>2020-12-29T10:55:00.000+08:00</published><updated>2020-12-29T10:55:01.402+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><title type='text'>CodeIgniter3 紀錄錯誤訊息</title><summary type="text">我們在做服務的時候在推出到正式機後會需要把錯誤訊息關掉，但是我們仍然需要知道到底正式機發生什麼事情了，這時候我們就需要把 log 記錄下來。apache 裡面當然有已經可以紀錄的功能了，但是其實 CodeIgniter 有內建這樣的功能。讓我們來試試看吧！Error Handling 功能說明頁我們先來講預設的部分第一步：我們先把 application/logs 這個資料夾設為可讀寫。第二步：config/config.php 的&amp;nbsp;log_threshold 設定一下。預設是0 ，我們如果把他設定成 1 系統就會把問題存在 application/logs 這個資料夾中|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 = Disables logging, Error logging TURNED OFF|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 =</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/6809599149382047466/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/6809599149382047466' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6809599149382047466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6809599149382047466'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/12/codeigniter3.html' title='CodeIgniter3 紀錄錯誤訊息'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-6856303540978867511</id><published>2020-12-29T09:50:00.002+08:00</published><updated>2020-12-29T09:50:20.700+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="email"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>php 寄送 email  [SendGrid] 介紹</title><summary type="text">&amp;nbsp;我們在寄送 email 的時候要自己做一個&amp;nbsp; SMTP Server 超麻煩，而且還不一定會正常讓使用者收到，常常都會遇到擋信的問題，那我們如果要用 email 進行重要的行為，例如訂單的確認信或是註冊帳號的通知就會有影響了現在要介紹的這個 SendGrid 就是一個第三方的發信服務，有很多的發信服務都有提供 php sdk 也有免費額度，為什麼我要特地介紹這個呢？1. 有直接在 azure 上可以設定2. 每月免費額度高達 25,000 （用得了超過這個數字，麻煩甘願一點付錢好嗎）首先我們在 azure 後台上新增資源 搜尋 SendGrid接著按照步驟一步一步走完即可對！我不想寫過程了 單純填表格填一填就好需要注意的是1. 他的 php sdk 有支援 composer 同時你當然也是可以選擇在 github 直接下載進去使用2. 要記得在 env 中設定你的 </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/6856303540978867511/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/6856303540978867511' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6856303540978867511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6856303540978867511'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/12/php-email-sendgrid.html' title='php 寄送 email  [SendGrid] 介紹'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK33lKseSMS8XTmcnqhfi_GOyEQ8hfpDTyUlqvabDPPZbeTS3kYr_e0dhXS8dot8KD_UMuGou-TTpfHelIegUG9CdW8sbgm1w7Tp-HFRSyQND2pgQXQMTSC5kdQ_CEzHTKjP8wrSOo71bL/s72-w400-h176-c/%25E6%2588%25AA%25E5%259C%2596+2020-10-30+16.01.04.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-2902498856278708183</id><published>2020-12-28T10:58:00.001+08:00</published><updated>2020-12-28T10:58:05.265+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter4"/><title type='text'>CodeIgniter 4 利用 helper 共用變數設定</title><summary type="text">CodeIgniter 中要在每個頁面共用變數一直都沒有一個很好的解法，在 CodeIgniter3 中我們可以在 Config 資料夾中建立一個檔案，塞一堆陣列利用 $this-&amp;gt;config-&amp;gt;item(&#39;foo&#39;) 來解決。CodeIgniter4 中該怎麼解決呢？我們可以利用 helper 的方法來解決：檔案在 app/Helpers/ 這裡面我們可以建一個檔案，例如：我們要取用的時候直接呼叫 __classlist() 就可以取出這個陣列了。這樣做的好處呢，就是我們可以在這個 function 裡面加上一些語法而不是死板板的參數設定。在使用上會更有彈性喔</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/2902498856278708183/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/2902498856278708183' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/2902498856278708183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/2902498856278708183'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/12/codeigniter-4-helper.html' title='CodeIgniter 4 利用 helper 共用變數設定'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgut1GZDDuwR83xOW1KbZFGf2U64ChiK39MSlqbvs8eAa8_07NwYTf1_dI6xe-aCn7QkMTo23yZFMbjmUXIHhcofoaJzw1EuW9Ha7Mh2g3sz3Sl2OsfQKpyh5uzR2fzTbzTccDq7LYAvceA/s72-w640-h406-c/%25E6%2588%25AA%25E5%259C%2596+2020-12-28+10.54.04.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-5457843153653986733</id><published>2020-09-11T16:04:00.000+08:00</published><updated>2020-09-11T16:04:04.470+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Certbot"/><category scheme="http://www.blogger.com/atom/ns#" term="https"/><title type='text'>Certbot Let&#39;s Encrypt 快速發行證書套件 Centos版</title><summary type="text">我們之前有提到過可以用&amp;nbsp; Let`s Encrypt 得到免費憑證。雖然也是很方便，但是現在已經可以用 yum 快速安裝摟。這個軟體叫做certbotcertbot 基本上是沒有在預設的儲存庫中所以我們要先抓取回來step1sudo dnf install epel-releasesudo dnf install certbot python3-certbot-apache mod_ssl在上面出現紅字的部分 我們可以看到這是屬於 apache 版本，如果我們是 nginx 可以改用sudo dnf install certbot python3-certbot-nginx&amp;nbsp;mod_ssl直接可以執行摟step2sudo certbot記得每三個月要更新憑證certbot renew --dry-run</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/5457843153653986733/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/5457843153653986733' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5457843153653986733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5457843153653986733'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/09/certbot-lets-encrypt-centos.html' title='Certbot Let&#39;s Encrypt 快速發行證書套件 Centos版'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-5397454385667506885</id><published>2020-07-28T10:39:00.002+08:00</published><updated>2020-07-28T10:42:34.553+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>php 校正不必要或是錯誤的 html 格式  tidy</title><summary type="text">我們在做編輯後台的時候會開放讓使用者貼上自己想要的格式，但是很不幸的，大部分的情況下使用者都會從很奇怪的編輯軟體貼過來。 這時候如果遇到瀏覽器無法解析的時候就會變成原始碼被印在葉面上。或是整個大跑版。php 其實就有 tidy 模組可以使用，他可以幫你改寫成正確的html format通常的環境沒有預先安裝 所以我們先 installsudo yum -y install php-tidysudo service httpd restart接著使用也是很簡單$config[&quot;show-body-only&quot;]=true;$html = tidy_repair_string($str, $config);tidy_repair_string 就可以幫我們校正了，需要注意的是 show-body-only 這如果沒有加 他會回傳整組的 html 包含 head 那些其他我也不知道要幹嘛的用法</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/5397454385667506885/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/5397454385667506885' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5397454385667506885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5397454385667506885'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/07/html-tidy.html' title='php 校正不必要或是錯誤的 html 格式  tidy'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-3872379891133876003</id><published>2020-07-14T17:12:00.002+08:00</published><updated>2020-12-28T10:59:05.204+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CI4"/><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter4"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniter 4 Libraries 引入使用方式</title><summary type="text">CodeIgniter 4 這個版本開始全面更新架購，所以原先的 libraries 引入使用的方式也要調整。我們先由 Conntroller 說起。&amp;lt;?php&amp;nbsp;namespace App\Controllers;use App\Libraries\Mylibraries;class Myfun extends BaseController{&amp;nbsp; &amp;nbsp; function demo1(){&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; $lib = new&amp;nbsp;Mylibraries();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; $data = $lib-&amp;gt;function1();&amp;nbsp;&amp;nbsp; &amp;nbsp;}}?&amp;gt;接著就是 library 本身&amp;lt;?</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/3872379891133876003/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/3872379891133876003' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/3872379891133876003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/3872379891133876003'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/07/codeigniter4-libraries.html' title='CodeIgniter 4 Libraries 引入使用方式'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-3666683490471275366</id><published>2020-01-15T12:21:00.005+08:00</published><updated>2020-01-15T12:27:18.285+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Centos"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB"/><category scheme="http://www.blogger.com/atom/ns#" term="Service"/><title type='text'>解決 mongodb 無法啟動的問題</title><summary type="text">某天起床後 mongo 忽然活不回來了
查了一下錯誤訊息的 log:

Docs: https://docs.mongodb.org/manual
&amp;nbsp; Process: 120107 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=1/FAILURE)
&amp;nbsp; Process: 120104 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
&amp;nbsp; Process: 120101 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
&amp;nbsp; Process: </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/3666683490471275366/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/3666683490471275366' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/3666683490471275366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/3666683490471275366'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2020/01/mongodb.html' title='解決 mongodb 無法啟動的問題'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-620084378227814776</id><published>2019-11-15T13:09:00.002+08:00</published><updated>2019-11-15T13:09:42.296+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="自定義函式庫"/><category scheme="http://www.blogger.com/atom/ns#" term="陣列處理"/><title type='text'>php 二維陣列進行假的 group by 資料篩選</title><summary type="text">有些時候我們在資料庫存取後會拿到一些很髒的資料，要作資料的篩選整理。
這次我們要做的動作就是，兩個相同格式的二為陣列要去過濾出重複的某個 key 值不要讓他一直出現：
例如：




$arr1[] = array(
 &#39;order_id&#39;=&amp;gt;&#39;00001&#39;,
 &#39;name&#39;=&amp;gt;&quot;james&quot;,
);
$arr1[] = array(
 &#39;order_id&#39;=&amp;gt;&#39;00002&#39;,
 &#39;name&#39;=&amp;gt;&quot;james 2&quot;,
);
$arr1[] = array(
 &#39;order_id&#39;=&amp;gt;&#39;00003&#39;,
 &#39;name&#39;=&amp;gt;&quot;james 3&quot;,
);


$arr2[] = array(
 &#39;order_id&#39;=&amp;gt;&#39;00002&#39;,
 &#39;name&#39;=&amp;gt;&quot;james 2&quot;,
);
$arr2[] = array(
 &#39;order_id&#39;=&amp;gt;&#39;</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/620084378227814776/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/620084378227814776' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/620084378227814776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/620084378227814776'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2019/11/php-group-by.html' title='php 二維陣列進行假的 group by 資料篩選'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-3733151996144483146</id><published>2018-03-22T14:09:00.000+08:00</published><updated>2018-03-22T14:10:39.910+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csv"/><category scheme="http://www.blogger.com/atom/ns#" term="javaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="json"/><title type='text'>[JavaScript] 將 CSV 檔案轉換成 JSON 資料</title><summary type="text">我們在拿到客戶提供的資料的時候常常會拿到 excel 檔案（這算幸福的）
至少我們可以簡單的利用一些軟體轉成 csv丟進資料庫裡處理。如果搭配個後端 API 基本上資料都不會是太大的問題可以做成 JSON 供 JavaScript 使用，但是如果在沒有後端或是資料庫的環境中呢？


首先我們先把 csv 檔案放到 server上 利用 $.get() 取得內容，接著將內容String 丟進我們待會會用到的 csvJSON 外掛 function 中。就會取得 JSON
但是這個時候的 JSON 還是 String 的形態所以還無法被解析，我們再加個 JSON.parse() 就可以拿到整個 JSON 物件摟！




function 來源：
https://gist.github.com/iwek/7154578</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/3733151996144483146/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/3733151996144483146' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/3733151996144483146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/3733151996144483146'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2018/03/javascript-csv-json.html' title='[JavaScript] 將 CSV 檔案轉換成 JSON 資料'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-1489737141802184780</id><published>2018-03-20T10:22:00.002+08:00</published><updated>2018-03-20T10:23:47.890+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fullCalender"/><category scheme="http://www.blogger.com/atom/ns#" term="前端"/><title type='text'>fullCalender 語系設定</title><summary type="text">fullCalender 是一個非常好用的行事曆外掛。
官網在這
https://fullcalendar.io

不過他預設的日期格式是使用英文（月份這樣超麻煩，我是文盲）



好險其實他有提供語言包
locale-all.js
這個檔案在官方下載的檔案
然後掛上


&amp;lt;script src=&#39;fullcalendar/fullcalendar.js&#39;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&#39;fullcalendar/locale-all.js&#39;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;

&amp;nbsp; $(function() {

&amp;nbsp; &amp;nbsp; $(&#39;#calendar&#39;).fullCalendar({
&amp;nbsp; &amp;nbsp; &amp;nbsp; locale: &#39;zh-tw&#39;
&amp;nbsp; &amp;nbsp; </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/1489737141802184780/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/1489737141802184780' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/1489737141802184780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/1489737141802184780'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2018/03/fullcalender.html' title='fullCalender 語系設定'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi42P0U2Jaxuzl90_qWFGA91LsrtasOgiWRVVAagL8Iv17iztj-9NKCKj-ZZ_13sQ6_cG9R2mGofG76_UlXBQQg0vxyvE0WdLRYmoJtt2RejG4hchatkgGQKKF-3MQLto9ws5FFZCWb2Xnz/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2018-03-20+%25E4%25B8%258A%25E5%258D%258810.15.02.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-7025342105075546297</id><published>2017-09-15T12:46:00.004+08:00</published><updated>2017-09-15T12:46:50.483+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB"/><title type='text'>php CodeIgniter 使用  mongoDB</title><summary type="text">這是使用的外掛
http://intekhab.in/mongodb-library-for-codeigniter.html

安裝設定主要是要設定 config 和 library 這個部分可以在這邊直接找到 github 連結下載即可。

使用的方式在官方的文件上面並沒有很清楚的著墨 所以我們在這邊補充一下


資料新增 insert

$user = array(&#39;username&#39; =&amp;gt;&quot;james&quot;,
   &#39;name&#39; =&amp;gt; &quot;wolf2&quot;,&quot;time&quot;=&amp;gt;time());
$this-&amp;gt;mongo_db-&amp;gt;insert(&#39;users&#39;, $user);



這樣就完成了資料新增的動作了，需要注意的一點就是：雖然 mongodb 是 json 的儲存方式。但是 CIMongo 要求輸入的格式是陣列喔


取得資料 get


$list = </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/7025342105075546297/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/7025342105075546297' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7025342105075546297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7025342105075546297'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2017/09/php-codeigniter-mongodb.html' title='php CodeIgniter 使用  mongoDB'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-5876279892422531614</id><published>2017-04-06T14:35:00.000+08:00</published><updated>2017-04-07T11:24:41.317+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Vue.js"/><title type='text'>Vue.js 取得 ajax 清單資料</title><summary type="text">



在 Vue.js 中並沒有內建自己的呼叫 ajax 功能，所以 Vue.js 官方有推薦一款&amp;nbsp;axios。

我們可以先試著用一下


axios.get(&quot;api_booking/get_order_list&quot;,{
          params: {
            member_id: &quot;james&quot;
          }
        }).then(response =&amp;gt; this.items = response.data.datalist);


上面這個例子就是我們可以利用 get 的方式去取得 API 的資料。我們可以看到這裡面直接可以使用 then 也就是說可以確認 api 是跑完了以後才執行裡面的動作。



new Vue({
    el:&quot;#list&quot;,
    data:{
      items: []
    },
</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/5876279892422531614/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/5876279892422531614' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5876279892422531614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5876279892422531614'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2017/04/vuejs-ajax.html' title='Vue.js 取得 ajax 清單資料'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizIDqxvJY-cmI6xc_Qt3_g2r7n-gVxWGmQ7PNx9T-QXyzGRqh2aq5_iCu26vgqMmyqmmgXT3tyk_VI5Jm72YcNvqzAqtpvr3K2TeVnpdVB1xdY1gKmLX3M4lmiraw6ezAXSdfP8BahCAWX/s72-c/logo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-322645666444173228</id><published>2017-03-23T14:40:00.001+08:00</published><updated>2017-06-23T16:27:09.915+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="YUM"/><category scheme="http://www.blogger.com/atom/ns#" term="網管工具"/><title type='text'>Let&#39;s Encrypt 免費 SSL 憑證</title><summary type="text">之前～ SSL 憑證都是要錢的，又很難設定。申請還要填寫一堆表格。自從 2016年開始陸陸續續有一些免費的SSL憑證可以拿來使用。重點是 小灰狼剛剛試用了一下，設定超簡單。在 Linux 的指令裡面就可以完成

1.先利用 yum 安裝需要的相關套件

sudo yum install gcc libffi-devel python-devel openssl-devel git





2.安裝設定程式

cd /usr/share
sudo git clone https://github.com/letsencrypt/letsencrypt letsencrypt






3.給他跑下去執行

cd /usr/share/letsencrypt
sudo ./letsencrypt-auto --apache -d 你要申請的網域名稱


設定自動更新憑證


sudo /</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/322645666444173228/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/322645666444173228' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/322645666444173228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/322645666444173228'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2017/03/lets-encrypt-ssl.html' title='Let&#39;s Encrypt 免費 SSL 憑證'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-7252053964755227380</id><published>2017-01-09T12:51:00.003+08:00</published><updated>2017-01-09T13:03:18.556+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="firebase"/><title type='text'>利用 Firebase 達成 Facebook 第三方登入</title><summary type="text">第三方登入在目前的網站系統中已經是廣泛被使用的功能了。

如果你跟我一樣每次實作 Facebook 登入都會遇到奇怪的問題的話～不妨可以試試看利用 Firebase 實作。














第一步仍然是要記得載入 Firebase 的環境：

這個我就不多說了









接著就是在 Firebase 上的設定了，請依照上圖指示動作。至於應用程式ＩＤ和應用程式密鑰是指 Facebook 那邊的應用程式設定，請記得在 Facebook 那邊申請。最後記得將重新導向 URI 新增到應用程式設定。





接著







我們要來去設定重新導向網域，這樣才可以開始實作（Facebook 彷彿就不用特別設定應用程式網址了，改用上一張圖的重新導向 URI&amp;nbsp;）





接著就是實作的 code



文件在此









function login(){
</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/7252053964755227380/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/7252053964755227380' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7252053964755227380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7252053964755227380'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2017/01/firebase-facebook.html' title='利用 Firebase 達成 Facebook 第三方登入'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdKelBZkygj5sCCseWgHd-aVW3cEG2mGpJvicBxgRQOBz55pHHbKkV6oR3numfrLDUWQB9k9DPaH2uphAvb5077nS0jVzbF88lxqF7f77KuzF5PdekVxlq4KP7dMRQiotZVYNhu-joSCky/s72-c/firebase-facebook.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-4765412855696076169</id><published>2016-09-27T16:32:00.000+08:00</published><updated>2016-09-27T16:32:17.582+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Laravel"/><title type='text'>Laravel 5.3 自學筆記 （建立 Auth 登入系統）</title><summary type="text">剛建立起來的 Laravel 真是有夠無聊，因為裡面什麼都沒有。所以我們拿一個會員登入功能來驗證一下他是不是超級強大。

首先先建立一個路由：


php artisan make:auth



接著，把資料庫備齊（先假設你 .env 設定過了）


php artisan migrate


如此一來，artisan 就已經幫你把 登入相關的功能 Login,Register,Logout 都寫好了～神奇吧！




註冊畫面





登入畫面，還有記住帳號和忘記密碼的功能





忘記密碼




Auth 文件</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/4765412855696076169/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/4765412855696076169' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/4765412855696076169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/4765412855696076169'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/09/laravel-53-auth.html' title='Laravel 5.3 自學筆記 （建立 Auth 登入系統）'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdQPWjhwAn6h7vkCHqtz_3DOwy_x5PkjYx66cyAYhL3XvmC7XcGvu-eIK03es8j2mpjXUj2HOcY7lur-bfiTif7BnjiSn_VJJdYxc5Gq4l1xGnECNsVPnFkKiwBrJTVAYNkMfESNYqMsGt/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-09-27+%25E4%25B8%258B%25E5%258D%25884.24.56.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-7977363557511389675</id><published>2016-09-06T17:46:00.001+08:00</published><updated>2016-09-06T17:46:33.444+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Laravel"/><title type='text'>Laravel 5.3 自學筆記 (建立第一個  Laravel 專案)</title><summary type="text">經過一番努力後，終於我們要來建立第一個專案了。
一樣用指令


cd ~/Homestead
vagrant up 
vagrant ssh


順利連線進入到 VM 後，利用 Composer 建立一個新專案：


composer create-project laravel/laravel --prefer-dist


composer 就會將最新版本的 larvel 安裝到你的指定目錄底下。這時我們打開當初設定 ~/.homestead/Homestead.yaml 檔案裡面的網址就可以顯示 Laravel 的歡迎畫面摟






Laravel 5.3 自學筆記 (環境安裝篇)</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/7977363557511389675/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/7977363557511389675' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7977363557511389675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7977363557511389675'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/09/laravel-53-laravel.html' title='Laravel 5.3 自學筆記 (建立第一個  Laravel 專案)'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Z4z9LROaqkicv9QZQVHkizAN_VEIfpZB9w9GS6r5ZrNDrs4GHyCEZMkuZZdLPG0QgKq0sbJ8IQou2U3PvyDCU7IMaZ4d5RTEpf_DCIJrt6k9w6AaaBtphoaspCfXURJBmvG5qT6LCI1C/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-09-06+%25E4%25B8%258B%25E5%258D%25885.38.46.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-5177817009871250778</id><published>2016-09-06T17:28:00.000+08:00</published><updated>2016-09-06T17:46:51.329+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Laravel"/><title type='text'>Laravel 5.3 自學筆記 (資料庫連線)</title><summary type="text">我們在寫 php &amp;amp; MySQL 的時候很習慣用 phpMyAdmin 這個東西在做控制。
遇到 Laravel 的時候我們該怎麼辦呢？其實我們可以直接用桌面軟體連線啊～～～





Sequel Pro
下載路徑：http://www.sequelpro.com/


如果在設定 Homestead 的時候我們沒有更動的話 ，DB name 應該要是 homestead 。 IP 是 192.168.10.10

預設會給一個帳密 homestead / secret

接著就可以快樂的連線進去摟！

不過基本上對於 Laravel 來說，資料庫連線軟體本身並不重要。因為 Laravel 希望我們使用 artisan 指令下去進行資料庫格式的維護。

利用 artisan 指令我們就可以對於 db 進行 Eloquent 的維護。這個好處是，我們每次的更動都會被記錄下來。當</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/5177817009871250778/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/5177817009871250778' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5177817009871250778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/5177817009871250778'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/09/laravel-53_6.html' title='Laravel 5.3 自學筆記 (資料庫連線)'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFlUA2LpvQksjFSbp0XWzy4ByMSF5X8N7Gdpu1eUwegodossUnqndeNsBqGfrl4NSav3HrmVcE5HSj8oYZboiWs4Hhb8B1FNGgbFLaS8m7VJ_Pc0qUuQlUIctFkkM0gJb2EJMGkaF6kOKp/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-09-06+%25E4%25B8%258B%25E5%258D%25885.13.30.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-6554239676606828842</id><published>2016-09-06T12:30:00.003+08:00</published><updated>2016-09-06T17:48:07.095+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Laravel"/><title type='text'>Laravel 5.3 自學筆記 (環境安裝篇)</title><summary type="text">據說... Laravel 最困難的地方在環境的安裝
沒錯 我也搞好久。

開始摟！


Step1 &amp;nbsp;安裝 VirtualBox 不解釋直接過去安裝啦


Step2 &amp;nbsp;安裝 Vagrant 也是請直接過去安裝


Step3 &amp;nbsp;下載 Homestead

在終端機下執行：


vagrant box add laravel/homestead


這個過程滿久的，可以去大個便之類的。在這邊大概先講一下我們剛剛在做什麼？
Laravel 建議的開發環境在 VM 下執行，甚至上線也用 VM 這樣比較容易做到環境的統一。所以我們一開始要先安裝 VirtualBox 。

但是我們該不會每次要寫 code 先打開 VirtualBox 吧！這時候就有一個會幫你控制 VM 的傢伙出來了就是 Vagrant &amp;nbsp;我們可以在不用手動打開 VirtualBox </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/6554239676606828842/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/6554239676606828842' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6554239676606828842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/6554239676606828842'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/09/laravel-53.html' title='Laravel 5.3 自學筆記 (環境安裝篇)'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-8590471412133839871</id><published>2016-06-24T16:00:00.001+08:00</published><updated>2016-06-24T16:02:51.890+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>Firebase database 在 web 上面的基礎運用 (搜尋資料內容)</title><summary type="text">


我們要在 firebase database 中取得資料，其實可以利用 key 的方式取得。就會非常的省事。只需要指定好 ref 的路徑。像這樣：


firebase.database().ref(&quot;/member/key&quot;).on(&quot;value&quot;,function(data){
 console.log(data.val());
})



但是我們並不是一定會拿到key，很多情況下我們要搜尋某個值的存在，例如要找人名或電話號碼之類的。這時候我們需要另一個方式來達成：



 firebase.database().ref(&quot;/member&quot;).orderByChild(&quot;mobile&quot;).equalTo(&quot;我的電話號碼&quot;).on(&#39;value&#39;, function(data) {
    console.log(data.val());
  });



這時候 </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/8590471412133839871/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/8590471412133839871' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/8590471412133839871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/8590471412133839871'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/06/firebase-database-web_24.html' title='Firebase database 在 web 上面的基礎運用 (搜尋資料內容)'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg09_Fo9pSARKrD0tGfL5_b-okLb_kVOgoq1EI-pZxubd6rHE7gkDXW3urGl4K8Z3hN122gcoDjy2o1rdMrHejhCDu9vsq6pXTTJAA5muu4J_i_t8Qj2VNpEXqEqLsngsk2qfZTDwIAKgkT/s72-c/firebase_logo_shot.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-8780110144933653794</id><published>2016-06-23T17:40:00.001+08:00</published><updated>2016-06-24T15:10:27.545+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="javaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>Firebase database 在 web 上面的基礎運用 (讀取資料)</title><summary type="text">


上一篇
Firebase database 在 web 上面的基礎運用 (新增資料)
我們知道可以一直丟東西過去給 firebase 由於他是一個 nosql 的概念，所以資料正規並沒有像是一般的 sql 資料庫那麼嚴謹。
那我們要怎麼拿回我們的資料呢？

取得全部清單


firebase.database().ref(&quot;/member/&quot;).on(&#39;value&#39;, function(data) {
   console.log(data.val());
   // console.log(data.val().mobile());
   $.each(data.val(),function(k,v){
    console.log(v);
    console.log(v.addr);
   })
});



由上面的例子看：
ref -&amp;gt; 路徑節點
</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/8780110144933653794/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/8780110144933653794' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/8780110144933653794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/8780110144933653794'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/06/firebase-database-web_23.html' title='Firebase database 在 web 上面的基礎運用 (讀取資料)'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZYjLtx4_G9GaUD1KYIaYUb1uA_PcKUfEnoEZBqse3bxZ0Ql8q3ZGMSRjw7XK5lWJVG4PAK9xwGSl60ULUrIItK5EliFITB13DNC5a0Q4JsF1KRiZs9CC33TjtVLF7Wf_4n9yau71PNtHn/s72-c/firebase_logo_shot.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-7907866126029791713</id><published>2016-06-23T17:03:00.003+08:00</published><updated>2016-06-24T15:10:41.654+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="firebase"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="javaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>Firebase database 在 web 上面的基礎運用 (新增資料)</title><summary type="text">


會找到這邊來我們就不解釋什麼是 Firebase 了。在一些簡單的案子中我們可以直接用他的js sdk 進行資料的儲存，不用自己管 database。

1.載入環境
https://www.gstatic.com/firebasejs/live/3.0/firebase.js



 
 // Set the configuration for your app
  // TODO: Replace with your project&#39;s config object
    var config = {
    apiKey: &quot;請去 filebase申請&quot;,
    authDomain: &quot;請去 filebase申請&quot;,
    databaseURL: &quot;請去 filebase申請&quot;,
    storageBucket: &quot;&quot;,
  };
  </summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/7907866126029791713/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/7907866126029791713' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7907866126029791713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7907866126029791713'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/06/firebase-database-web.html' title='Firebase database 在 web 上面的基礎運用 (新增資料)'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLpjDIYV-fwxkXUtHj9mY4GyM2yu5IMxhG36WV7ccRmgyLLL6svxQvJGTvvOlzVshXLv_ptItynSQaCBt8V7ffHISbcZhzcgPMVw1IH4Kns4165RPJvgqTwIegJhRuhR0M_nejNoRVRpNX/s72-c/firebase_logo_shot.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8432704824884642955.post-7871350098778300455</id><published>2016-04-08T10:53:00.002+08:00</published><updated>2016-04-08T10:53:53.252+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google API"/><category scheme="http://www.blogger.com/atom/ns#" term="好用模組"/><title type='text'>利用 google MAP API 取得座標之間的距離</title><summary type="text">這次我收到的任務是，客戶給我一堆經緯度地理座標，我必須要去計算每個點和我之間的距離。然後要進行排序的動作
如果是之前的解法的話，我必須要自己去計算每個點和我自己的距離，寫入到一個陣列後再進行排序。其實非常的累，Google推出的這隻API可以讓我們把經緯度一次都丟給他，然後他直接回傳結果給我們（真是非常佛心）。

不過還是有規範限制的：

每個要求最多能有 25 個起點或 25 個目的地；
每個要求最多能有 100 個元素 (起點數乘以目的地數)。
要使用 GOOGLE API_KEY

在官方文件的範例中點選 API_KEY 直接它就會幫你套用 API_KEY (怎麼這麼好)


&amp;nbsp;













這個範例會從載入地圖畫面 到顯示地址，座標轉換通通都一次丟出來。我們也可以針對裡面做精簡的處理，就可以單純地取得列表（google 並沒有幫我們排序，我們可以自己來）。</summary><link rel='replies' type='application/atom+xml' href='http://phpwolf.blogspot.com/feeds/7871350098778300455/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8432704824884642955/7871350098778300455' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7871350098778300455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8432704824884642955/posts/default/7871350098778300455'/><link rel='alternate' type='text/html' href='http://phpwolf.blogspot.com/2016/04/google-map-api.html' title='利用 google MAP API 取得座標之間的距離'/><author><name>James 周駿憲</name><uri>http://www.blogger.com/profile/03993504121976745521</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_E79LT6W3MgP-sGngZCErOr5InYcBOd4NQL_j53e2x6kN6WLFwXp4TA5aw-IE7p-Yp5x5NQv1DYb-rTwEpYyojHOUI5lLB4YOPWk3mQxDEdqMv-bp82EE4qKd-k3_GcnfFQqsrfFJnT8e/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-04-08+%25E4%25B8%258A%25E5%258D%258810.50.46.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>