Skip to content

Commit 564a9d1

Browse files
committed
Added phone number button
1 parent 4ba6dab commit 564a9d1

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

app/Http/Controllers/UserController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public function addLink(request $request)
107107
'button' => 'required'
108108
]);
109109

110-
if (stringStartsWith($request->link,'http://') == 'true' or stringStartsWith($request->link,'https://') == 'true' or stringStartsWith($request->link,'mailto:') == 'true')
110+
if ($request->button == 'phone')
111+
$link1 = 'tel:' . $request->link;
112+
elseif (stringStartsWith($request->link,'http://') == 'true' or stringStartsWith($request->link,'https://') == 'true')
111113
$link1 = $request->link;
112114
else
113115
$link1 = 'https://' . $request->link;

database/seeders/ButtonSeeder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,14 @@ public function run()
9898
'name' => 'patreon'
9999
],
100100

101-
102101
[
103102
'name' => 'paypal'
104103
],
105104

105+
[
106+
'name' => 'phone'
107+
],
108+
106109
[
107110
'name' => 'pinterest'
108111
],

littlelink/icons/phone.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/views/littlelink.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ function get_operating_system() {
233233
@foreach($links as $link)
234234
@php $linkName = str_replace('default ','',$link->name) @endphp
235235
@if($link->button_id === 0)
236-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-title button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" target="_blank">
237-
{{ $link->title }}</a></div>
236+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-title button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" target="_blank">{{ $link->title }}</a></div>
237+
@elseif($link->name === "phone")
238+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-default button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ $link->link }}"><img alt="button-icon" class="icon hvr-icon" src="{{ asset('\/littlelink/icons\/')}}phone.svg"></i>{{ $link->title }}</a></div>
238239
@elseif($link->name === "custom" and $link->custom_css === "" or $link->custom_css === "NULL")
239240
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $link->name }} button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" target="_blank"><i style="color: {{$link->custom_icon}}" class="icon hvr-icon fa {{$link->custom_icon}}"></i>{{ $link->title }}</a></div>
240241
@elseif($link->name === "custom" and $link->custom_css != "")

0 commit comments

Comments
 (0)