I don't know if this late response but for anyone who is having this challenge, this is fairly simple;
<?php namespace App\Http\Controllers
use Endroid\QrCode\QrCode;
class ImageController extends Controller{
public function _construct(QrCode $qrCode){
$this->qrCode = $qrCode;
}
public function makeQrCode($text){
return $this->qrCode
->setText($text)
->setSize(300)
->setPadding(10)
->setErrorCorrection('high')
->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
->setLabel('My label')
->setLabelFontSize(16)
->render();
}
}
You route may look like this:
Route::get('image/qrcode/{$text}',[
'uses' => 'ImageController@makeQrCode',
'as' => 'qrcode'
]);
So later you can do this in your blade:
<img src="{!! route('qrcode',['text'=>'Hello world']) !!}" alt="QR Code">