Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit eec3535

Browse files
authored
Merge pull request #860 from vabrell/master
str_contains deprecated - docs out of date
2 parents e31dfc8 + b49ab20 commit eec3535

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/auth/setup.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ With this example rule, we only want to allow users to login if they are inside
135135
namespace App\Rules;
136136

137137
use Adldap\Laravel\Validation\Rules\Rule;
138+
use Illuminate\Support\Str; // Laravel >= 5.7
138139

139140
class OnlyManagersAndAccounting extends Rule
140141
{
@@ -150,7 +151,11 @@ class OnlyManagersAndAccounting extends Rule
150151
'ou=Managers,dc=acme,dc=org',
151152
];
152153

154+
// Laravel <= 5.6
153155
return str_contains($this->user->getDn(), $ous);
156+
157+
// Laravel >= 5.7
158+
return Str::contains($this->user->getDn(), $ous)
154159
}
155160
}
156161
```

0 commit comments

Comments
 (0)