migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Authentication\Http\Requests\Restaurant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RestaurantStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:100', 'regex:/^[a-zA-Z\s]+$/u'],
|
||||
'email' => [
|
||||
'nullable',
|
||||
'string',
|
||||
'email:rfc,dns',
|
||||
'max:100',
|
||||
'unique:users,email', // Ensure unique email for new users
|
||||
],
|
||||
'phone' => [
|
||||
'required',
|
||||
'string',
|
||||
'regex:/^(\+?\d{1,4}|\d{1,4})?\d{7,15}$/',
|
||||
'unique:users,phone', // Ensure unique phone for new users
|
||||
],
|
||||
'restaurant_type' => ['required', 'string', 'max:100'],
|
||||
'domain' => ['required', 'string', 'max:100', 'regex:/^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z]{2,}$/'],
|
||||
'address' => ['required', 'string', 'max:191'],
|
||||
'logo' => ['nullable'],
|
||||
'platform' => ['nullable', 'string', 'in:WEB,APP'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Authentication\Http\Requests\Restaurant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RestaurantUpdateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['nullable', 'string', 'max:100', 'regex:/^[a-zA-Z\s]+$/u'],
|
||||
'restaurant_type' => ['nullable', 'string', 'max:100'],
|
||||
'address' => ['nullable', 'string', 'max:191'],
|
||||
'logo' => ['nullable'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user