samedi 13 octobre 2018

How to Update table values with existing method in Laravel?

I am working with Laravel 5.6 with MySql database in My web app.

and I have following function method to add order,

public function addOrder()
{
$input = Input::all();

$subscribed= false;
if(isset($input['subscribed']))
{
$subscribed= true;
}

and In My system I have table name as vehicles as following,

**vehicles table**
id   name   number   adtype
1    car     123       0
2    van     159       0
3    car     258       0
4    lorry   147       0
5    van     298       0
etc..

Now I need update above table adtype values from 0 to 1 when click submit button regarding to above addorder function. then how can write code to update code in side above function????

My url as following....

http://localhost:8000/myads/1/edit/payment

route is,

Route::post('add-order', 'PaymentController@addOrder');



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire