Support the ongoing development of Laravel.io →
Authentication Security Requests
Last updated 2 years ago.
0

Is there a How-To-Use-Code-Tags-4-Dummies?

0

I get an error when trying to run this, but it might be a database error, this is how it's done, yea?

@code

<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class UserController extends Controller { # create user public function createUser(Request $request) { $this->validate($request, [ 'name' => 'required|unique:users|min:4' ]); } } @stop namespacing in the Request function, and than use it to validate the POST-variables
0

Also, if I want the name to be between 3 and 13 characters, can I type something like: @codeblock $this->validate($request, [ 'name' => 'required|unique:users|min:4, max:12' ]); @stop ?

0

You can use the 'between' rule for that.

https://laravel.com/docs/5.2/validation#rule-between

0

Sign in to participate in this thread!

Eventy

Your banner here too?

muppbarn muppbarn Joined 29 Mar 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.