<?php

namespace Myorders\FleetOps\Http\Requests\Internal;

use Myorders\Http\Requests\MyordersRequest;

class AssignOrderRequest extends MyordersRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return session('company');
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'order'  => ['required', 'exists:orders,public_id'],
            'driver' => ['required', 'exists:drivers,public_id'],
        ];
    }
}
