mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-15 02:07:56 -04:00
45 lines
960 B
PHP
45 lines
960 B
PHP
<?php
|
|
|
|
namespace Modules\Chat\Http\Requests\API;
|
|
|
|
use Modules\Chat\Entities\Group;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CreateGroupRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function prepareForValidation()
|
|
{
|
|
$this->sanitize();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return Group::$rules;
|
|
}
|
|
|
|
public function sanitize()
|
|
{
|
|
$input = $this->all();
|
|
|
|
$input['name'] = isset($input['name']) ? htmlspecialchars($input['name']) : '';
|
|
$input['description'] = isset($input['description']) ? htmlspecialchars($input['description']) : '';
|
|
|
|
$this->replace($input);
|
|
}
|
|
}
|