| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Providers;
- use Illuminate\Support\ServiceProvider;
- class AppServiceProvider extends ServiceProvider
- {
- /**
- * Register any application services.
- *
- * @return void
- */
- public function register()
- {
- //
- \DB::listen(function ($query) {
- $bindings = $query->bindings;
- $sql = $query->sql;
- foreach ($bindings as $replace) {
- $value = is_numeric($replace) ? $replace : "'" . $replace . "'";
- $sql = preg_replace('/\?/', $value, $sql, 1);
- }
- });
- }
- /**
- * Bootstrap any application services.
- *
- * @return void
- */
- public function boot()
- {
- //
- }
- }
|