<?php

namespace App\Classes\Modules\Banks\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Bank;

class ResetsBanksDefault extends AbstractUpdateRecord
{

    /**
     * @param Bank $bank
     * @return void
     */
    public function execute(Bank $bank)
    {
        $bank->company->banks()->where('type', $bank->type)->update(['default' => false]);
    }

}