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 試用](https://skychoy.com/posts/7-laravel-jetstream-%E8%A9%A6%E7%94%A8 "Laravel/Jetstream 試用") #### 1.`.env` 進行設定 意思是此域名下其他所有子...

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

tailwindcss 設定指定行數的 truncate [line-clamp]

```bash # Using npm npm install @tailwindcss/line-clamp #or Using Yarn yarn add @tailwindcss/line-clamp ``` ```javascript // tailwind.config.js module.exports = { plugins: [ require('@tailwin...

2022-05-15
Read more

Laravel Debug Bar 只顯示給admin或指定用戶

## 事源 有個即將上線的網站是用 Laravel ,因為是有用戶登入的功能,也預計會有不少流量,所以會擔心的效率的問題 [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar "barryvdh/laravel-...

2022-05-04
Read more

Laravel 人性化顯示時間

`App\Providers\AppServiceProvider.php` 找到`boot()` 加入這句用來設定你想要的語言,比如繁體中文就填`zh_TW` ```php use Carbon\Carbon; public function boot() { Carbon::setLocale('zh_TW'); } ``` b...

2022-04-09
Read more

Laravel 顯示回覆樓層

### 使用Blade計算 不使用數據庫的值,而直接使用 `$loop->index` ```php @if((request()->get('page')>0)) #{{$loop->index+1+(request()->get('page')*15)-15}} @else #{{$loop->index+1}} @endif ``` 上...

2022-03-23
Read more
Recommended topics
Technology