PostRequest.php 353 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Requests;
  3. use App\Http\Requests\Request;
  4. class PostRequest extends Request
  5. {
  6. public function authorize()
  7. {
  8. return true;
  9. }
  10. public function rules()
  11. {
  12. return [
  13. 'titre' => 'required|max:80',
  14. 'contenu' => 'required',
  15. 'tags' => ['Regex:/^[A-Za-z0-9-éèàù]{1,50}?(,[A-Za-z0-9-éèàù]{1,50})*$/']
  16. ];
  17. }
  18. }