Try deleting the comma before the last parenthesis in the following lines:
$newuser = array( 'name' => Input::get('name'), 'number'=>Input::get('number'), 'location'=>Input::get('location'), 'phone'=>Input::get('phone'), );
Is your $newuser variable accesible globally?
The problem enters the function post without adding data to the database
this problem
public function save() { $newStudent = array( 'name' => Input::get('name'), 'number'=>Input::get('number'), 'location'=>Input::get('location'), 'phone'=>Input::get('phone'), );
$rules = array(
# validation code
'name' => 'Required|Min:3|Max:80|Alpha',
'number'=> 'Required|Between:3,64',
'location'=> 'Required|Min:3|Max:80|Alpha',
'phone'=>'Required|Between:3,64',
);
$newStudent = new User($newStudent); $newStudent->save(); }
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community