How do i increase a column of a table using Laravel 5?
It's very simple to increment an specific column of a table using laravel.
Conditions: The specific column's data type should be an 'int' type.
procedures:
1. Link your app model to your linking section with this code
use App\Loanapplication ;
2. then just write the following codes to increment your specific database column
$loanapplication = Loanapplication::where('MemberId', $MemberId)->increment('PayedInstallment');
'Loanapplication' is model.
'where('table column name', 'variable name for comparing')'
'increment('column name of your table which you want to increase')' is function for increasing a column by 1
Conditions: The specific column's data type should be an 'int' type.
procedures:
1. Link your app model to your linking section with this code
use App\Loanapplication ;
2. then just write the following codes to increment your specific database column
$loanapplication = Loanapplication::where('MemberId', $MemberId)->increment('PayedInstallment');
Where,
'$loanapplication' is a variable.'Loanapplication' is model.
'where('table column name', 'variable name for comparing')'
'increment('column name of your table which you want to increase')' is function for increasing a column by 1
Comments
Post a Comment