<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Ixudra\Curl\Facades\Curl;

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

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191);
        date_default_timezone_set('Asia/Jakarta');
        view()->composer('*',function($view){
            // if(session()->has('token')){
            //     $response = Curl::to(api_url('presensi/auth/login'))
            //     ->withData([
            //         'permission' => 'cek-user',
            //         'token' => session()->get('token')
            //     ])->asJson()->post();
            //     $user = $response->cek_user->data;
            // }else{
            //     $user = null;
            // }
            // $view->with('v_user', $user);
        });
    }
}
