2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LaravelでAPIを作る時のデバッグにClockWork

Posted at

APIメインの開発をLaravelで作るときの、効率いいデバッグ方法を調べました。
普通であれば、LaravelDebugbarを入れてデバッグすると、呼び出されたSQLなどが見れて開発が捗ります。
が、これはviewにかかれるので、jsonのレスポンスの場合は使えません。
こう言った場合はClockworkを使うと良さそうです。

インストール

$ composer require itsgoingd/clockwork

次にChrome拡張のClockworkをいれます。

Clockwork

デバッグ

F12からClockworkのタブを見れば、Performanceや使っているModel、呼び出したSQLが確認できます。

Clockwork chrome

また clock() というヘルパーも提供されて、dd() のように使えて、ClockworkのLogに吐き出されます。
すごく便利で開発が捗りますね。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?