[WP插件] Easy WP SMTP 補丁,解決 「ERROR 550:Bad HELO」問題

Wordpress 在VPS /Hosting 中常常預到server沒有PHPMAL,所以就要使用SMTP來send信。 簡單隨便安裝一個插件即可,但如果預上`網站`和`電郵`服務在兩台不同的server上,你可以設定了SMTP都會出錯 [PHPMailer 550 Ba...

2023-03-31
Read more

Select2 更換預設定 id/text key代號

Select2 內置了接收 ajax json 資料時,預設是`id` `text` 常見的情況是 API / Ajax url 是別人提供的所以無法更改輸出 更常見的就是,Json 中預計給你顯示的文字是`name` 而不是`text`,那麼只能用下面的方法去取...

2022-09-14
Read more

Tailwind CSS 整合 Laravel 常用設定

### 安裝及初始化 ```bash npm install -D tailwindcss@latest postcss@latest autoprefixer@latest npx tailwindcss init ``` ### 推薦的插件 ```bash npm install @tailwindcss/line-clamp ``` ```javascript /...

2022-07-22
Read more

Laravel 強制執行 https

相信近年來大家都使用了SSL,在不同的控制版面或至cloudflare等等cdn都有強制轉跳https的功能 但我所指的是Laravel層面的強制使用https,即使`.env` 使用的網址不是http,系統都會強行轉到https ## 事件源頭 我建...

2022-07-18
Read more

VSCode 針對指定目錄進行TailwindCSS 及Bootstrap 代碼提示

我會針對項目及做獨立設定 那麼在項目的root folder中建立`.vscode/settings.json` ```json { "tailwindCSS.files.exclude": [ "**/.git/**", "**/node_modules/**", "**/.hg/**", "**/resources...

2022-07-08
Read more

Laravel 簡易跨域名登入/驗證(仍在測試嘗試中)

我以Jetstream做登入測試,讀前參考:Laravel/Jetstream 試用1..env 進行設定意思是此域名下其他所有子域名都能享共sessionSESSION_DOMAIN = .yourdomainSESSION_DRIVER = database (或 redis)SESSION_COOKIE = xxxx_session //自己選個代號2. 確定一樣兩個網站都安裝了Jetstream3. 把2個網站的.env 連接同一個 database只需要這樣簡單的設定,就能做到同多個子域名同時登入、同時登出,不知還有沒有其他漏洞,仍在測試中謹慎使用,...

2022-06-07
Read more

Larvel Mail 基本使用

以下例子使用Laravel 內容的 Mail ### 基本寄信 ##### command line 執行 ```shell php artisan make:mail Welcome ``` ##### App\Mail\WelcomeMail.php ```php namespace App\Mail; use Illuminate\Bus\Queueabl...

2022-05-27
Read more

Laravel 以Json 格式保存資料的方法及原因

### 數據庫中建立一個以txt作格式的欄位 ```php $data = [ 'title' => $request->title, 'user_name' => $request->user_name ]; $topic->data = json_encode($data); $topic->save(); ``` 這樣便會才json 格式...

2022-05-26
Read more

Laravel Pagination 分頁功能

### 1. 基本使用 eg:每次顯示15個 ```php $row = User::paginate(15); ``` ##### 1.1帶上原本現有url 的query功能 `withQueryString()` 有時你的網址可能會同時有其他query, 比如搜尋頁面,分類頁面等等,加上`wit...

2022-05-25
Read more

Laravel debug 只向指定用戶/指定IP 顯示

## 前言 系統推出後,可能會預到無法預計的錯誤,在我們的測試環境中試了無數次也沒有發生問題,但一旦開放了用戶的CURD我們就會發現多了些ERROR404/ERROR500,你可以去找log file 來查找bug,但太低率了,我們希...

2022-05-17
Read more
Recommended topics
Technology