Files
sam-api/app/Providers/AppServiceProvider.php

35 lines
689 B
PHP
Raw Normal View History

2025-07-17 10:05:47 +09:00
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
2025-07-17 10:05:47 +09:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* 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;
});
2025-07-17 10:05:47 +09:00
}
}