mardi 1 mars 2016

Laravel putting 2 form values together and checking if their unique

I have recently started using Laravel5.2 and I wanted to know if their is a way to actually check if 2 form values are unique? I can do this with one but I have a form input value for First Name and one for Second name, what I want to do is something like below..

$fullName = $firstName . ' ' . $secondName;
//check if $fullName is unique

I mean I would love to have just one form value that you can enter booth first and second name into but I feel there is too much checking to actually check if theres only 2 words (2 names) in the form input.

So is there an easy way to check if firstName and secondName put together are unique.. such as below

say my first name was John and my second name was Smith, how could I check that "John Smith" was unique in the database under the "username" column? (1 column).



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Qr5Ndc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire