Home » Php » Move a record from one table to another laravel

Move a record from one table to another laravel

Posted by: admin October 26, 2017 Leave a comment

Questions:

I’ve a list of users , where admin can approve or deny.Maintain two tables if admin clicks “approve” a user,the records ‘ld move from that table to another table.How can I achieve this?
In view,

<span>
    <a href="{!! route('approve', ['id' => $user->id]) !!}">
        Approve
    </a>
</span> <br/>

In route,

<?php 

Route::get(
            'approve/{id}', 
            [ 'uses' => '[email protected]', 'as' => 'approve' ] 
           );

?>

In controller,

<?php

public function postApprove( $id )
{
 **?**
}

?>
Answers: