File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 6
6
use Illuminate \Support \Facades \Hash ;
7
7
use Cohensive \OEmbed \Facades \OEmbed ;
8
8
use Illuminate \Support \Facades \Schema ;
9
+ use Illuminate \Support \Facades \Route ;
9
10
10
11
use Auth ;
11
12
use DB ;
@@ -121,6 +122,23 @@ public function AddUpdateLink($id = 0)
121
122
$ data ['LinkData ' ] = $ linkData ;
122
123
$ data ['LinkID ' ] = $ id ;
123
124
$ data ['title ' ] = "link " ;
125
+ $ data ['linkTypeID ' ] = "1 " ;
126
+
127
+ if (Route::currentRouteName () != 'showButtons ' ) {
128
+ $ links = DB ::table ('links ' )->where ('id ' , $ id )->first ();
129
+
130
+ $ bid = $ links ->button_id ;
131
+
132
+ if ($ bid == 1 or $ bid == 2 ){
133
+ $ data ['linkTypeID ' ] = "1 " ;
134
+ } elseif ($ bid == 42 ) {
135
+ $ data ['linkTypeID ' ] = "3 " ;
136
+ } elseif ($ bid == 43 ) {
137
+ $ data ['linkTypeID ' ] = "4 " ;
138
+ } else {
139
+ $ data ['linkTypeID ' ] = "2 " ;
140
+ }
141
+ }
124
142
125
143
foreach ($ data ['LinkTypes ' ]->toArray () as $ key => $ val ) {
126
144
if ($ val ['typename ' ] === $ linkData ['typename ' ]) {
You can’t perform that action at this time.
0 commit comments