Search code examples
htmllaravelgenerated-code

Laravel Allow Only registered users to read a html generated magazine (pdf) from FlippingBook


In Laravel I want to let only registered user to access and read a html generated magazine in Flipping book (It generates a html/flash magazine with ui), it generates index.html . This would be done by a route filter if it where a view. But since i have generated code is there a way to do this without rewriting the code that flipping book generated (maybe with .htaccess) to let only registered users read the magazines? and redirect not logged in to main page?

Flipping book example magazine (also flipping book generates for whole page not as modal)

Any hint or help would be appriciated thank you.


Solution

  • On the route, add the middleware option for auth. This will redirect people when someone tries to access the route that hasn't logged in.

    Route::get('magazine', ['uses' => 'SomeController@someMethod', 'middleware' => 'auth']);