aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrankie B <git@diskfloppy.me>2023-07-19 01:50:07 +0100
committerGitHub <noreply@github.com>2023-07-19 01:50:07 +0100
commitfb045348cf4c72a2f523b6a0ce360b40d4d60ff3 (patch)
tree81c8c5353e6e5d11de13a04a5dfc3cd7ca3d718f
parente627033600a5f6222c076d4e4265646b0f070877 (diff)
feat: move bookmarks to database (#9)
* Move bookmarks to SQL DB * Increment version
-rw-r--r--config/app.php2
-rw-r--r--resources/views/pages/bookmarks.blade.php24
2 files changed, 20 insertions, 6 deletions
diff --git a/config/app.php b/config/app.php
index 275fd7c..f151b73 100644
--- a/config/app.php
+++ b/config/app.php
@@ -17,7 +17,7 @@ return [
*/
'name' => env('APP_NAME', 'diskfloppy.me'),
- 'version' => '5.4.5',
+ 'version' => '5.4.6',
/*
|--------------------------------------------------------------------------
diff --git a/resources/views/pages/bookmarks.blade.php b/resources/views/pages/bookmarks.blade.php
index 331d9fb..16d07cc 100644
--- a/resources/views/pages/bookmarks.blade.php
+++ b/resources/views/pages/bookmarks.blade.php
@@ -1,13 +1,27 @@
-<?php $categories = app('config')->get('bookmarks'); ?>
@extends('layouts.default')
@section('title', 'bookmarks')
@section('description', 'This is the personal homepage of floppydisk.')
@section('content')
+@php
+ $categories = DB::select('
+ SELECT id, name
+ FROM bookmark_categories
+ ORDER BY priority ASC
+ ');
+@endphp
+
@foreach ($categories as $category)
- <h1>{{ $category['name'] }}</h1>
- <ul>
- @foreach ($category['bookmarks'] as $bookmark)
- <li><a href="{{ $bookmark['url'] }}">{{ $bookmark['name'] }}</a> - {{ $bookmark['description'] }}</li>
+ <h1>{{ $category->name }}</h1>
+ @php
+ $sites = DB::select('
+ SELECT name, url, description
+ FROM bookmark_sites
+ WHERE category_id = ? ORDER BY priority ASC
+ ', array($category->id));
+ @endphp
+ <ul>
+ @foreach ($sites as $site)
+ <li><a href="{{ $site->url }}">{{ $site->name }}</a> - {{ $site->description }}</li>
@endforeach
</ul>
@endforeach