jeudi 20 juin 2019

How to pass whole url as params?

I want allow user to scan QR code and go to website. This is search results with params in url address like

http://example.com/qr-code/http://example.org/search/user_id=12&model_id=4&role_id=8

My route is set as

Route::get('qr-code/{data?}/{size?}', 'QrController@qrCode')->name('qr-code');

so i hope my $data will get url:

http://example.org/search/user_id=12&model_id=4&role_id=8

My Controller has

public function qrCode(Request $request, $data = null, $size = 60) {
    dd(88);
    $data = (empty($data)) ? env('APP_URL') : $data;
    return view('qr.code')->with('qr', QrCode::size($size)->generate($data));
} 

But i can't even see dd(88) route redirect to main page. How can i fix that ?



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2XZyzJp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire