ldc-supportweb/app/Http/Requests/Invoice/InvoiceSetDateRequest.php
2022-08-30 13:21:07 +00:00

33 lines
646 B
PHP

<?php
namespace App\Http\Requests\Invoice;
use Illuminate\Foundation\Http\FormRequest;
class InvoiceSetDateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
/** @var \App\Models\User|null $user */
$user = auth()->user();
return auth()->check() && $user->isAdmin();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'date' => 'required|date'
];
}
}