I am writing a controller where i have used base_convert function. But instead of converting it, it shows only input value not converted value in output.
Eg: for the below controller it's showing only the $currentID
, not the converted one. Why is this happening? If anyone find the problem, please share it with us.
public function getShortUrl(Request $request)
{
$this->validate($request,[
'url' => 'required|unique:urls'
]);
$url = new Url();
$url->url = $request->Input(['url']);
$url->save();
$currentId = $url->id;
$url_code=base_convert($currentId,16,8);
$url->code ='http://go.'.$url_code;
$url->save();
// return redirect('getURL');
}