You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
639 B
PHP
31 lines
639 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ContactRequest extends FormRequest
|
|
{
|
|
/**
|
|
* @return string[]
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
// todo: required first name if no last name and vice versa
|
|
|
|
return [
|
|
'customer_id' => 'required|exists:customers,id',
|
|
'first_name' => 'string',
|
|
'last_name' => 'string',
|
|
'email' => 'string',
|
|
'phone' => 'string',
|
|
'notes' => 'string',
|
|
];
|
|
}
|
|
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|