<?php

namespace Server\Controllers\Observers;

use Server\Database\Models\Admin;
use Server\Library\Controllers\ServicesController;

class WithdrawalObserver extends ServicesController
{

    public function created($withdrawal)
    {
        $admin = Admin::where('id', 1)->first();

        $title = 'New Withdrawal Request';

        $body = 'New withdrawal request of ' . $withdrawal->amount . ' ' . $withdrawal->currency;

        $this->sender->sendEmail([$admin->email], $body, $title);
    }
}