I need to generate a number from database and show it on input at view.
I use function on MySQL to achieve that so I use raw expression.
$nomor = DB::table('customers')-
>selectRaw('concat(year(now()),lpad(month(now()),2,0),lpad(id, 3, 0))
as nomor')
->where('id', '=', $customers->id)->get();
When I pass the variable into view,
<input type="text" class="form-control @error('nomor') is-invalid @enderror" id="nomor" placeholder="" name="nomor" value="{{ $nomor }}">
"[{"nomor":"201909001"}]"
my expected result is:
201909001 withoutquote