Skip to content

Laravel Telescope ​

Nguồn gốc: Bản dịch từ Laravel Telescope

Giới thiệu (Introduction) ​

Laravel Telescope là debug assistant tuyệt vời cho Laravel. Telescope cung cấp insights về request, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, v.v.

Cài đặt (Installation) ​

bash
composer require laravel/telescope
bash
php artisan telescope:install
php artisan migrate

Chỉ cài ở Local ​

Nếu chỉ dùng cho development:

bash
composer require laravel/telescope --dev

Cấu hình (Configuration) ​

File config/telescope.php cấu hình watchers và options.

Data Pruning ​

Tự động xóa dữ liệu cũ qua scheduled command.

Dashboard Authorization ​

Dashboard truy cập tại /telescope. Cấu hình authorization cho production.

Lọc dữ liệu (Filtering) ​

Filtering Entries ​

Chỉ ghi lại entries cụ thể.

Filtering Batches ​

Lọc batch entries.

Tagging ​

Telescope tự gán tag cho entries (Eloquent model class, authenticated user ID...). Có thể tùy chỉnh tags.

Available Watchers ​

  • Batch Watcher — Queued batch
  • Cache Watcher — Cache hit/miss/update/forget
  • Command Watcher — Artisan command execution
  • Dump Watcher — Variable dumps
  • Event Watcher — Events
  • Exception Watcher — Exceptions
  • Gate Watcher — Gate & policy checks
  • HTTP Client Watcher — Outgoing HTTP requests
  • Job Watcher — Queued jobs
  • Log Watcher — Log entries
  • Mail Watcher — Emails
  • Model Watcher — Eloquent model changes
  • Notification Watcher — Notifications
  • Query Watcher — Database queries
  • Redis Watcher — Redis commands
  • Request Watcher — Incoming requests
  • Schedule Watcher — Scheduled tasks
  • View Watcher — View rendering

Hiển thị Avatar ​

Tùy chỉnh avatar trong Telescope dashboard.