mardi 28 février 2017

How to send data from one table to another in Laravel?

I have problem with send data from one table to another. I want delete data from first table too. Is it possible to do that operation under one button ? I have my records in table. I don't know how to route this operation.

This is my idea,but it didnt work. I get error Invalid route action

    public function dodaj($id)
{   
    $operacje = DB::table('operacja')->where('id',$id)->get();
    $operacje = DB::table('potwierdzona')->insert($operacje);
    $operacje = Operacja::findorFail($id);
    $operacje->delete();
    return redirect('patients');
}

My route is Route::post('potwierdzone/$id/dodaj/','PotwierdzonaController');



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

Aucun commentaire:

Enregistrer un commentaire