statamic / ideas

đŸ’¡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Set protection via Route::statamic() #443

Open edalzell opened 3 years ago

edalzell commented 3 years ago

Bug Description

Want to create a client page, protected by login. URL will be something like /clients/{client-slug}. Docs say you can define routes in routes.php

image

...but not sure how.

How to Reproduce

  1. Add route to web.php:
    Route::statamic(
    '/clients/{client}',
    'client.profile',
    [
        'protect' => 'logged_in',
    ]
    );
  2. Log out of CP
  3. Visit that route

Environment

Statamic 3.0.2 Pro Laravel 7.27.0 PHP 7.4.9 No addons installed

jasonvarga commented 3 years ago

That doc is outdated. Notice it talks about routes.php and not web.php. It's from before we changed from our own routes file to just putting routes in Laravel's routes file.

However, I think it would be good to support it within Route::statamic() routes, in some way.

I've updated the docs for now, though.

duncanmcclean commented 3 years ago

As it's not a bug, it might be a good idea to move this issue to statamic/issues.

I don't have access to that feature, unfortunately. Maybe one of the gents could do it? @jasonvarga

github-actions[bot] commented 3 years ago

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

edalzell commented 3 years ago

This would still be great to have.

wm-simon commented 3 years ago

Yes, I would need it too. Is there a chance to get this in the next weeks?