<?php

namespace Mehrab\Payment\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Mehrab\City\Repositories\CityRepo;
use Mehrab\RolePermission\Repositories\RoleRepo;
use Spatie\Permission\Models\Role;

class settlement_store_request extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */

    public function rules()
    {
        return [
            'name' => ['required','string','min:2'],
            'cart' => ['required','numeric','digits:16'],
            'shaba' => ['required','string','regex:/^(?:IR)(?=.{24}$)[0-9]*$/'],
            'amount' => ['required','numeric','min:100000','max:'.auth()->user()->amount],
        ];
    }
}
