35 lines
689 B
PHP
35 lines
689 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
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;
|
|
});
|
|
}
|
|
}
|