1 頁 (共 1 頁)

监听SQL事件

發表於 : 2015-12-07 22:16:33
yehlu
http://laravelbase.com/collections/1/65


app/Providers/AppServiceProvider.php

代碼: 選擇全部

<?php
namespace App\Providers;
use DB;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        DB::listen(function($sql, $bindings, $time) {
            //
        });
    }
    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}