<?php

namespace App\Providers;

use App\Http\ViewComposers\CountriesListComposer;
use Faker\Factory;
use Faker\Generator;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(181);

        View::composer('partials.component.address', CountriesListComposer::class);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(Generator::class, function () {
            return Factory::create('ms_MY');
        });
    }
}
