mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-05-02 10:58:46 +02:00
Added controller to save custom CSS
Added controller to display and save custom CSS on the edit-link page. See: https://blog.littlelink-custom.com/upcoming-features/
This commit is contained in:
parent
a53087f7a6
commit
abb463efa4
@ -192,11 +192,12 @@ class UserController extends Controller
|
||||
$link = Link::where('id', $linkId)->value('link');
|
||||
$title = Link::where('id', $linkId)->value('title');
|
||||
$order = Link::where('id', $linkId)->value('order');
|
||||
$custom_css = Link::where('id', $linkId)->value('custom_css');
|
||||
$buttonId = Link::where('id', $linkId)->value('button_id');
|
||||
|
||||
$buttons = Button::select('id', 'name')->get();
|
||||
|
||||
return view('studio/edit-link', ['buttonId' => $buttonId, 'buttons' => $buttons, 'link' => $link, 'title' => $title, 'order' => $order, 'id' => $linkId]);
|
||||
return view('studio/edit-link', ['custom_css' => $custom_css, 'buttonId' => $buttonId, 'buttons' => $buttons, 'link' => $link, 'title' => $title, 'order' => $order, 'id' => $linkId]);
|
||||
|
||||
}
|
||||
|
||||
@ -207,6 +208,7 @@ class UserController extends Controller
|
||||
'link' => 'required',
|
||||
'title' => 'required',
|
||||
'button' => 'required',
|
||||
'custom_css' => 'required',
|
||||
]);
|
||||
|
||||
if (stringStartsWith($request->link,'http://') == 'true' or stringStartsWith($request->link,'https://') == 'true' or stringStartsWith($request->link,'mailto:') == 'true')
|
||||
@ -221,10 +223,11 @@ class UserController extends Controller
|
||||
$order = $request->order;
|
||||
$button = $request->button;
|
||||
$linkId = $request->id;
|
||||
$custom_css = $request->custom_css;
|
||||
|
||||
$buttonId = Button::select('id')->where('name' , $button)->value('id');
|
||||
|
||||
Link::where('id', $linkId)->update(['link' => $link, 'title' => $title, 'order' => $order, 'button_id' => $buttonId]);
|
||||
Link::where('id', $linkId)->update(['link' => $link, 'title' => $title, 'order' => $order, 'button_id' => $buttonId, 'custom_css' => $custom_css]);
|
||||
|
||||
return redirect('/studio/links');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user