allgy
V2EX  ›  问与答

larael 5.5 如何打印 sql?

  •  
  •   allgy · Mar 1, 2019 · 2089 views
    This topic created in 2812 days ago, the information mentioned may be changed or developed.

    版本 laravel 5.5 LTS

    GrassSand
    GrassSand
    Mar 1, 2019
    1
    toSql()
    安装 debugbar 一劳永逸
    zibber
    zibber
    Mar 1, 2019
    2
    DB::connection()->enableQueryLog();
    DB::table('xxx');
    $queries = DB::connection()->getQueryLog();
    print_r($queries);
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1277 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:50 · PVG 07:50 · LAX 15:50 · JFK 18:50
    ♥ Do have faith in what you're doing.