I have the following code for my post sign up page on my site.
$email = $request['email'];
$username = $request['username'];
$password = bcrypt($request['password']);
$mmail = $request['mmail'];
$terms = $request['terms'];
$user = new User();
$user->email = $email;
$user->username = $username;
$user->password = $password;
$user->mmail = $mmail;
$user->terms = $terms;
$user->save();
I need to know if it is possible to simplify my code incase I add new sign up options. What I'm trying to do is create a variable for each item in the $request array which can then be used by the $user->sqltable = $sqltableitem
Something like
foreach ($REQUESTITEM?? as $???){
???
}
Is this possible and any other suggestions?