Support the ongoing development of Laravel.io →
Authentication Security Forms
Last updated 2 years ago.
0

You're missing some things I think: isATeamManager always returns true ...

I have never used that Form::input functionality. I just do a @if in my view to check the value.

Try:

public function isATeamManager($user_id)
    {

$return = true;

if ($user_id == 1) {
        $return = true;
}

return $return;

    }

Then to test: in your controller:

if (Auth::user()->isATeamManager("1"))

to return true.

if (Auth::user()->isATeamManager("2"))

to return false.

0

Hi illuminate3

I know i didn't realy finish the isATeamManager function, i created this one just for a test.

But if i finish this function like mentioned above the input field will be set to readonly and will still be editable by the (chrome F12) console. This will be a security risk.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.