Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Smashing's avatar

Hide Create and Edit button

Is there a way to hide this 2 bottoms from showing or is not possible ?

0 likes
4 replies
automica's avatar

@smashing if you are looking only allow authenticated users to access these buttons, you can use the @auth directive in your blade file.

eg

@auth
    // The user is authenticated.
	<button>Some button</button>
@endauth
Smashing's avatar

hi,

i'm curios if i can hide it something like in css display:none;

litvinjuan's avatar

It is possible. But there are trillions of ways to do it.

Please provide more details about when you want them to short or not. Are you talking about a blade view or using Vue or other JS framework?

Without context, we cannot answer much.

automica's avatar

@smashing hiding a button using css isn’t that great as if you turn off css all your buttons appear. Also bots can spider your pages and they’ll be able to see your buttons in the DOM.

There’s two steps to security here, if you think worse case. Firstly ensure the route being called by the button has a permissions check on it so it can’t be hit by someone who knows the url. Secondly remove the button element from the DOM so there is nothing to click.

Security by obscurity (hiding stuff) isn’t much security - it’s like hiding your key under the mat by your front door. Sometimes that’s ok but it’s not a proper fix

Please or to participate in this conversation.