error message if message too short
This commit is contained in:
parent
97d1be40c8
commit
85c039902d
@ -2,9 +2,23 @@
|
||||
|
||||
namespace App\Web\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Antadis\API\Front\Exceptions\HttpBadRequestException;
|
||||
use Antadis\API\Front\Web\Controllers\ContactController as BaseContactController;
|
||||
|
||||
use ApiTools;
|
||||
|
||||
class ContactController extends BaseContactController
|
||||
{
|
||||
|
||||
public function create(Request $request) {
|
||||
$msg = ApiTools::getValue('msg', false);
|
||||
|
||||
if (strlen($msg) < 20) {
|
||||
throw new HttpBadRequestException('Votre message doit contenir plus de 20 caractères.');
|
||||
}
|
||||
return parent::create($request);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user