feat: move bookmarks to database (#9)

* Move bookmarks to SQL DB
* Increment version
This commit is contained in:
floppydiskette 2023-07-19 01:50:07 +01:00 committed by GitHub
parent e627033600
commit fb045348cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 6 deletions

View file

@ -17,7 +17,7 @@
*/
'name' => env('APP_NAME', 'diskfloppy.me'),
'version' => '5.4.5',
'version' => '5.4.6',
/*
|--------------------------------------------------------------------------

View file

@ -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>
<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 ($category['bookmarks'] as $bookmark)
<li><a href="{{ $bookmark['url'] }}">{{ $bookmark['name'] }}</a> - {{ $bookmark['description'] }}</li>
@foreach ($sites as $site)
<li><a href="{{ $site->url }}">{{ $site->name }}</a> - {{ $site->description }}</li>
@endforeach
</ul>
@endforeach