碎片

  • ```mysql SELECT * FROM `notifications` WHERE JSON_EXTRACT(data, "$.user_name") = 'sky' ``` demo data `notifications.data` ```json {"id": "1", "user_name ": "sky"} {"id": "2", "user_name ": "Joe...

  • 一定要小心使用 ```php use Illuminate\Support\Facades\DB; //...... DB::unprepared(); ``` These are all prepared statement to prevent SQL injection into database. However you might needed to run query...

  • https://output.jsbin.com/xepererege/ ```javascript // Nested demo var nestedSortables = [].slice.call(document.querySelectorAll('.nested-sortable')); // Loop through each nested sortable element for...

  • https://jsfiddle.net/6au1onme/1/

  • https://codepen.io/vtno/pen/MXmpoy

  • php5.2+ ```php //$dir = delete folder $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($it, RecursiveIteratorItera...

  • https://web-crunch.com/posts/vanilla-javascript-form-validation https://codepen.io/webcrunchblog/pen/ZEWwvZy

  • ```php //$image base64 image $imageName = time() . 'ava.png'; $image = str_replace('data:image/png;base64,', '', $image); $image = str_replace(' ', '+', $image); Storage::disk('temp_avatar')->pu...

  • https://draculatheme.com/

  • ```php $email = 'email@email.com'; $content = "Hello, Welcome to our site."; $title = "Hi,welcome user!"; $data = [ 'content' => $content, 'tit...

  • ```bash brew uninstall php ``` 這樣就把你的php刪除了 但如果馬上重裝,又會看到貌似是之前的設定 應該手動把這個位置都刪除再重裝就ok `/opt/homebrew/etc/php/` 然後再重裝即可 順帶一提,如果你是使用m1的...

  • https://github.com/qishibo/AnotherRedisDesktopManager/releases

  • safari 經常自動將電話加上`tel:` 但可以加上鏈結後,會與網頁原本想顯示的配色有出入 所以可在`` 加入這句 ```html ```

  • ```json { "tailwindCSS.files.exclude": [ "**/.git/**", "**/node_modules/**", "**/.hg/**", "**/resources/views/admin/**" ], "html-css-class-completion.includeGlobPattern": "**/res...

  • https://www.youtube.com/watch?v=ES8vJcUqE7s

  • a base and simple js onclick confirm box `` Tag with Form ```html Delete ``` `` Tag ```html Delete ```

  • `App\Providers\AppServiceProvider `,添加以下兩項設定 ```php use Illuminate\Pagination\Paginator; public function boot() { Paginator::useBootstrap(); } ``` https://laravel.com/docs/8.x/pagination...

  • ```php $module_data = array(); foreach ($course_module as $k => $v) { $module_data[] = [ 'user_course_id' => $orm->id, 'course_id' => $reque...

  • select + where + with + orderBy + paginate ```php Post::select('title', 'id') ->where('user_id',$user->id) ->orWhere('name', 'LIKE', '%' . $name . '%') ->orderBy('updated_at', 'desc') ->...

  • https://stackoverflow.com/questions/54510043/bootstrap-and-select2-form-validation?answertab=votes#tab-top