Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/AppServiceProvider.php
<?php | <?php | ||||
namespace App\Providers; | namespace App\Providers; | ||||
use Illuminate\Support\Facades\Blade; | |||||
use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||
use Illuminate\Support\Facades\Schema; | use Illuminate\Support\Facades\Schema; | ||||
use Illuminate\Support\ServiceProvider; | use Illuminate\Support\ServiceProvider; | ||||
class AppServiceProvider extends ServiceProvider | class AppServiceProvider extends ServiceProvider | ||||
{ | { | ||||
/** | /** | ||||
* Register any application services. | * Register any application services. | ||||
Show All 30 Lines | public function boot() | ||||
Schema::defaultStringLength(191); | Schema::defaultStringLength(191); | ||||
// Log SQL queries in debug mode | // Log SQL queries in debug mode | ||||
if (\config('app.debug')) { | if (\config('app.debug')) { | ||||
DB::listen(function ($query) { | DB::listen(function ($query) { | ||||
\Log::debug(sprintf('[SQL] %s [%s]', $query->sql, implode(', ', $query->bindings))); | \Log::debug(sprintf('[SQL] %s [%s]', $query->sql, implode(', ', $query->bindings))); | ||||
}); | }); | ||||
} | } | ||||
// Register some template helpers | |||||
Blade::directive('theme_asset', function ($path) { | |||||
$path = trim($path, '/\'"'); | |||||
return "<?php echo secure_asset('themes/' . \$env['app.theme'] . '/' . '$path'); ?>"; | |||||
}); | |||||
} | } | ||||
} | } |