Protoqol / Prequel

Prequel for Laravel. Clear and concise database management. Unfortunately, not actively maintained due to time constraints.
https://packagist.org/packages/protoqol/prequel
MIT License
1.54k stars 96 forks source link

How can i put Prequel behind Laravel authentication? #110

Closed sarderiftekhar closed 3 years ago

sarderiftekhar commented 4 years ago

Hi,

Now the prequel is open to browse for anyone, how can I put it behind login and only for the application admin to view? Is there any feature like that?

MCKLtech commented 4 years ago

Late to the party here but you can add a Middleware then place it in the 'middleware' option the config file (prequel.php)

If you wanted all authenticated users to have access to Prequel (Which is not good for production as I assume everyone can log in) then it would look something like this:

'middleware' => [ 'web', 'auth' ],

Note: 'auth' is a standard middleware provided by Laravel.

What you really should do is look at packages that provide Roles and then only permit someone to view Prequel if they have that role