Files
sam-api/app/Providers/AppServiceProvider.php
hskwon e9d1e42359 fix : Tenant API 추가
- 테넌트 목록 조회
- 테넌트 정보 조회
- 테넌트 정보 수정
- 테넌트 등록
- 테넌트 삭제
- 테넌트 복구
2025-08-14 17:20:28 +09:00

42 lines
1.0 KiB
PHP

<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\DB;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
// 개발환경 + API 라우트에서만 쿼리 로그 수집
if (app()->environment('local')) {
// 콘솔/큐 등 non-HTTP 컨텍스트 보호
if (function_exists('request') && request() && request()->is('api/*')) {
DB::enableQueryLog();
}
}
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
Builder::macro('debug', function($debug = null) {
if (is_null($debug) && app()->environment('local')) {
$debug = true;
}
if ($debug) {
\DB::enableQueryLog();
}
return $this;
});
}
}