Can anyone help me to fix my code ? i've the concept but dont know how to write them into code in controller
$temp=DB::table('temporary')->get();
//dd($temp);
if($temp['tahun'] < 'current year'){
$temp['tahun'] = 'current year';
$temp['nomor'] = 'nomor+1';
$keluhan->no_laporan = $temp['nomor'];
} else {
$temp['nomor']++;
}
Condition : my table temporary has 2 attribute tahun(value=2017 int) and nomor (value=1 int) i want to check if my tahun < this current year (real time year, idk the code so i write current year) then my tahun become = this curent year AND my nomor++ (+1 from its value first) how do i wrte them into laravel code ? please kindly help, thank you buddy
$keluhanin the code?