app/Providers/AppServiceProvider.php
/**
     * Register any application services.
     *
     * @return void
     */
Register any application services.
@return void
Register any application services . @return void
public function register()
    {
        $this->app->bind(
            'Illuminate\Contracts\Auth\Registrar',
            'App\Services\Registrar'
            );
        $this->app->when('App\Customer')
                  ->needs('App\PaymentMethod')
                  ->give('App\RekeningPonsel');
        $this->app->when('App\Seller')
                  ->needs('App\PaymentMethod')
                  ->give('App\KartuKredit');
        $this->app->singleton('App\KartuKredit', function($app)
        {
            return new \App\KartuKredit;
        });
    }
public function register ( ) { $ this -> app -> bind ( 'Illuminate\Contracts\Auth\Registrar' , 'App\Services\Registrar' ) ; $ this -> app -> when ( 'App\Customer' ) -> needs ( 'App\PaymentMethod' ) -> give ( 'App\RekeningPonsel' ) ; $ this -> app -> when ( 'App\Seller' ) -> needs ( 'App\PaymentMethod' ) -> give ( 'App\KartuKredit' ) ; $ this -> app -> singleton ( 'App\KartuKredit' , function ( $ app ) { return new \ App \ KartuKredit ; } ) ; }
Register any application services.
Register any application services .
/*$this->app->bind(
            'App\PaymentMethod',
            'App\KartuKredit'
            );*/ //$cc = new \App\KartuKredit(2000, '4563474822737'); //$this->app->instance('App\PaymentMethod', $cc);