2026-03-11 23:33:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
class StoreDeclarationMentionRequest extends FormRequest
|
2026-03-11 23:33:10 +00:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
|
*/
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return $this->user() !== null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
|
*
|
|
|
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
|
|
|
*/
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
$workspaceId = $this->session()->get('current_workspace_id');
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'user_id' => [
|
|
|
|
|
'required',
|
|
|
|
|
'integer',
|
|
|
|
|
Rule::exists('workspace_user', 'user_id')
|
|
|
|
|
->where('workspace_id', $workspaceId),
|
|
|
|
|
],
|
|
|
|
|
'message' => ['required', 'string', 'max:500'],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|