1 | <?php |
||||
2 | |||||
3 | namespace Mckenziearts\LaravelOAuth; |
||||
4 | |||||
5 | class LaravelSocialite |
||||
6 | { |
||||
7 | /** |
||||
8 | * This function construct the socialite buttons with activated providers. |
||||
9 | * |
||||
10 | * @param string $type |
||||
11 | * |
||||
12 | * @return string |
||||
13 | */ |
||||
14 | public function socialiteButtons(string $type) |
||||
15 | { |
||||
16 | $providers = config('laravel-oauth.providers'); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
17 | $buttons = '<p class="socialite-buttons">'; |
||||
18 | |||||
19 | foreach ($providers as $provider => $status) { |
||||
20 | if ($status === true) { |
||||
21 | if (config('laravel-oauth.buttons.outline') === true) { |
||||
22 | $buttons .= '<a href="'.url("/auth/$provider").'" class="'.config('laravel-oauth.buttons.class').' btn-outline-'.$provider.'">'; |
||||
0 ignored issues
–
show
The function
url was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
23 | } else { |
||||
24 | $buttons .= '<a href="'.url("/auth/$provider").'" class="'.config('laravel-oauth.buttons.class').' btn-'.$provider.'">'; |
||||
25 | } |
||||
26 | |||||
27 | if (config('laravel-oauth.buttons.icon') === true) { |
||||
28 | $buttons .= "<i class='social-{$provider}'></i>"; |
||||
29 | } |
||||
30 | |||||
31 | $buttons .= trans("laravel-oauth::word.{$type}", ['provider' => $provider]); |
||||
0 ignored issues
–
show
The function
trans was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
32 | $buttons .= '</a>'; |
||||
33 | } |
||||
34 | } |
||||
35 | |||||
36 | $buttons .= '</p>'; |
||||
37 | |||||
38 | return $buttons; |
||||
39 | } |
||||
40 | } |
||||
41 |