2 years ago

save( ) a POST <Form > using an array ? laravel 5.6

Posted 2 years ago by belykia

Hello Everybody :

i m a beginner in laravel .

trying to solve the problem i used this link , but it doesn't help :( , i went back until the title "Creating The Task" .

i created a of 5 inputs ,in home.blade.php each one is a string :

AS Number peeringRS Yes No peeringDB AS-SET Contact

next step in the web.php , i wrote the following ligne : Route::post('/POST', '[email protected]');

then finally , i wrote the following code in PostController.php,in order to save the form in the database table :

public function store(Request $request) {

    $data = new Post ;
    $ASNumber= $request->input('ASNumber');

     $ASSET =$request->input('AS-SET');
   $data = array('asnumber'=>$ASNumber,'peeringrs'=>$choice,'peeringdb'=>$peeringDB,'AS


 return  redirect('/');    

the answer in the "" , was "Call to a member function save() on array" .

a last question , why should i redirect ???

Please sign in or create an account to participate in this conversation.