<?php

namespace App\Http\Requests\Member\Transaction;

use Illuminate\Foundation\Http\FormRequest;

class DeliverRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        $transaction = $this->transaction;
        $user = auth()->user();
        $isAdmin = auth()->user()->role->permissions->contains(function($value){
            return $value->code == "transaction.online";
        });
        return $isAdmin;
    }

    public function rules()
    {
        return [
            'note' => 'nullable|string',
        ];
    }
}
