<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Blade;
use App\Models\LiveChatSetting;
use App\Models\CustomScript;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        Paginator::useBootstrap();
        // Paginator::useBootstrapFive();

        Blade::directive('currency', function ($expression) {
            return "<?php echo number_format($expression, 2); ?>";
        });

        Blade::directive('customscript', function () {
    $customScripts = \App\Models\CustomScript::all();
    $output = '';

    foreach ($customScripts as $script) {
        $output .= $script->content;
    }

    return $output;
});
    }
}