create new user for web service

This commit is contained in:
2025-07-09 17:22:09 +03:30
parent 81467c40d2
commit 4aea986f45
3 changed files with 66 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Http\Requests\V3\RoadItem\WebService;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
class CheckRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
$user = Auth::user();
return (
$user->username === 'service_user257'&&
Hash::check('S3rv1ce@123', $user->password) );
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'from_date' => 'required|date_format:Y-m-d',
'to_date' => 'required|date_format:Y-m-d',
];
}
}