<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                | 擴展包 | 說明 | | --- | --- | | [laravel-lang/lang(opens new window)](https://publisher.laravel-lang.com/installation/) | 語言包 | | [endroid/qr-code(opens new window)](https://github.com/endroid/qr-code) | 二維碼生成 | | [erusev/parsedown(opens new window)](https://github.com/erusev/parsedown) | Markdown 解析器 | | [hisorange/browser-detect(opens new window)](https://github.com/hisorange/browser-detect) | 設備檢測 | | [houdunwang/arr(opens new window)](https://github.com/houdunwang/arr) | 數據增強 | | [mewebstudio/captcha(opens new window)](https://github.com/mewebstudio/captcha) | 圖形驗證碼 | | [mews/purifier(opens new window)](https://github.com/mewebstudio/purifier) | html 安全處理 | | [nwidart/laravel-modules(opens new window)](https://nwidart.com/laravel-modules/v6/introduction) | 項目模塊化處理 | | [socialiteproviders/wechat-web(opens new window)](https://socialiteproviders.com/WeChatWeb/) | 微信客戶端 H5 登錄 | | [socialiteproviders/weixin-web](https://doc.houdunren.com/%E6%8F%92%E4%BB%B6%E6%89%A9%E5%B1%95/Laravel/socialiteproviders/weixin-web) | 微信 PC 掃碼登錄 | | [spatie/image(opens new window)](https://spatie.be/docs/image/v1/usage/basic-usage) | 圖片壓縮處理(推薦) | | [Intervention/image(opens new window)](https://github.com/Intervention/image) | 圖像處理庫 | | [spatie/laravel-activitylog(opens new window)](https://spatie.be/docs/laravel-activitylog/v4/introduction) | 網站動態 | | [spatie/laravel-permission(opens new window)](https://spatie.be/docs/laravel-permission/v3/installation-laravel#) | 基于角色的權限控制 | | [yansongda/pay(opens new window)](https://github.com/yansongda/pay) | 多平臺支付處理 | | [barryvdh/laravel-debugbar(opens new window)](https://github.com/barryvdh/laravel-debugbar) | 調試面板 | | [barryvdh/laravel-ide-helper(opens new window)](https://github.com/barryvdh/laravel-ide-helper) | 生成自動提示文件 | | [laravel-api-response-helpers(opens new window)](https://github.com/f9webltd/laravel-api-response-helpers) | api資源響應幫助函數 | | [overtrue/easy-sms](https://github.com/overtrue/easy-sms) | 發送短信 | | [mpdf/mpdf](https://github.com/mpdf/mpdf) | pdf生成 | | [overtrue/laravel-pinyin](https://github.com/overtrue/laravel-pinyin) | Laravel-Pinyin | | [opcodesio/log-viewer](https://github.com/opcodesio/log-viewer) | opcodesio/log-viewer | | [textalk/websocket](https://github.com/Textalk/websocket-php) | textalk/websocket | | [intervention/image](https://image.intervention.io/v2/introduction/installation) | Intervention Image php 圖片處理 | ## 多語言 默認表單提示是英文的,我們可以安裝[語言包(opens new window)](https://publisher.laravel-lang.com/)構建多語言環境。 ~~~ composer require --dev laravel-lang/common laravel-lang/publisher laravel-lang/lang laravel-lang/attributes laravel-lang/http-statuses ~~~ 接下來發布服務提供者 ~~~ php artisan vendor:publish --provider="LaravelLang\Publisher\ServiceProvider" ~~~ 然后在命令行執行以下指令,添加中文語言包到**resource/lang**目錄 ~~~ php artisan lang:add zh_CN php artisan lang:add ug ~~~ 修改`config/app.php`配置文件,設置語言包(即語言包的目錄名) ~~~ 'locale' => 'zh_CN', ~~~ ## 驗證碼 使用[mewebstudio/captcha](https://doc.houdunren.com/%E6%8F%92%E4%BB%B6%E6%89%A9%E5%B1%95/Laravel/mewebstudio/captcha)可以方便的生成網站圖形驗證碼。 ![Preview](https://doc.houdunren.com/assets/img/68747470733a2f2f696d6167652e6962622e636f2f6b5a784d4c6d2f696d6167652e706e67-3556057.d2f863f7.png) 請參考官網文檔進行安裝,下面介紹如果生成支持前后臺分離的驗證碼。 修改**.env**配置文件,開啟驗證碼 ~~~ CAPTCHA_DISABLE=false ~~~ 在前臺框架 vue 或 react 中向以下地址發送請求,獲取驗證碼數據 ~~~ http://localhost/captcha/api/math ~~~ 在 postman 中測試接口,可以得到以下數據 ~~~ { "sensitive": false, "key": "$2y$10$819PNm1n6567hQRLoKpadOS6n.8u0F5YmnR6Nrw57KvmRL4z8gPDe", "img": "data:image/png;base64..." } ~~~ 前臺需要把 key 與用戶輸入的驗證碼數據提交到后臺,然后使用以下表單驗證規則進行驗證 ~~~ $rules = ['captcha' => 'required|captcha_api:'. request('key') . ',math']; ~~~ 有時前端需要設置代理,下面是**vite**中的代理設置 ~~~ server: { host: true, proxy: { '/api': { target: env.VITE_API_URL, changeOrigin: true, }, //驗證碼接口 '/captcha/api/math': { target: env.VITE_API_URL, changeOrigin: true, }, }, }, ~~~ ## 設備判斷 判斷移動、平板設備等場景還是很常見的。使用[browser-detect(opens new window)](https://github.com/hisorange/browser-detect)可以很容易的進行設備判斷。 **安裝擴展** ~~~ composer require hisorange/browser-detect ~~~ **常用功能** 下面介紹常用的功能,更多功能的使用請查看[官方文檔(opens new window)](https://github.com/hisorange/browser-detect#)。 **判斷瀏覽器** ~~~ use Browser; // 判斷設備類型 Browser::isMobile(); Browser::isTablet(); Browser::isDesktop(); // 瀏覽器檢測 if (Browser::isFirefox() || Browser::isOpera()) { $response .= '<script src="firefox-fix.js"></script>'; } // 操作系統檢測 if (Browser::isAndroid()) { $response .= '<a>Install our Android App!</a>'; } elseif (Browser::isMac() && Browser::isMobile()) { $response .= '<a>Install our iOS App!</a>'; } ~~~ **blade 模板** ~~~ @mobile <p>這是移動模板!</p> @include('your-mobile-template') @endmobile @tablet <p>這是平板模板!</p> <link rel="stylesheet" href="tablet.css" title="Reduce the page size, load what the user need"> @endtablet @desktop <p>這是桌面模板!</p> @enddesktop ~~~ ## 圖片處理 使用[spatie/image(opens new window)](https://github.com/spatie/image)擴展包可以進行圖片壓縮、裁切等處理。 **安裝擴展包** ~~~ composer require spatie/image ~~~ **等比例裁切圖片** 下面是等比例以原圖片中心裁切圖片,并將裁切后的圖片保存為 public/images/test.jpeg ~~~ Image::load('images/hd.jpeg') ->crop(Manipulations::CROP_CENTER, 500, 100) ->save(public_path('images/test.jpeg')); ~~~ # pdf生成 先安裝 ~~~ composer require mpdf/mpdf ~~~ 添加font ![](https://img.kancloud.cn/e6/b7/e6b7aff6d4e6206fb10c59e9af0f1dd5_435x464.png) 然后配置字體 ![](https://img.kancloud.cn/ea/83/ea83df89a6ba20b631c5abcf787802a7_1447x811.png) ~~~ "alkatip" => [ 'R' => "alkatipbasmatom.ttf", 'B' => "alkatipbasmatom.ttf", 'I' => "alkatipbasmatom.ttf", 'BI' => "alkatipbasmatom.ttf", 'useOTL' => 0xFF, 'useKashida' => 75, ], "ukiji" => [ 'R' => "UKIJTor.ttf", 'B' => "UKIJTor.ttf", 'I' => "UKIJTor.ttf", 'BI' => "UKIJTor.ttf", 'useOTL' => 0xFF, 'useKashida' => 75, ], ~~~ > 我使用的UKIJTor,alkatip 測試沒通過 使用方法 ~~~ $mpdf = new Mpdf([ 'mode' => 'utf-8', 'margin_top' => 30, 'margin_left' => 30, 'margin_right' => 30, 'default_font' =>'ukiji' //'default_font' =>'alkatip' ]); $mpdf->SetHeader($header_title); $mpdf->defaultheaderline = 1;//頁眉線寬度 $mpdf->defaultfooterline = 1;//頁腳線寬度 /*pdf頭部*/ $mpdf->WriteHTML($html); $out_file = “www/wwwroot/admin/public/test.pdf” $mpdf->Output($out_file,'f'); ~~~ # Intervention Image php 圖片處理 ~~~ <?php namespace App\Services; use Illuminate\Support\Facades\Storage; use Intervention\Image\ImageManagerStatic as Image; class ImageService{ public function __construct(){ require_once base_path('package/intervention_image/autoload.php'); } //壓縮并且添加水印 public function remoteImageResizeAndWatermark($img_file, $width = 0, $height = 0, $limiter_width = 700){ $source_img = Storage::disk('ftp_root')->url($img_file); //打開資源圖片 $image = Image::make($source_img); //打開水印圖片 $watermark = Image::make(public_path('icon/watermark.png')); //寬度大于 700 ,壓縮圖片 if ($image->width() > $limiter_width){ $image = $image->resize($width, $height); //添加水印 $watermark = $watermark->resize($width, $height); }else{ //添加水印 $watermark = $watermark->resize($image->width(), $image->height()); } $image->insert($watermark); $image->save_uqur($img_file); return $img_file; } } ~~~ or ~~~ // include composer autoload require 'vendor/autoload.php'; // import the Intervention Image Manager Class use Intervention\Image\ImageManagerStatic as Image; // configure with favored image driver (gd by default) Image::configure(['driver' => 'imagick']); // and you are ready to go ... $image = Image::make('public/foo.jpg')->resize(300, 200); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看